diff --git a/.gitignore b/.gitignore index 8970ed2c..4099c17b 100644 --- a/.gitignore +++ b/.gitignore @@ -175,6 +175,7 @@ logs # local data postgres-data parquet-data +parquet-data-indexers data # streamlit diff --git a/clickhouse/Dockerfile b/clickhouse/Dockerfile new file mode 100644 index 00000000..8b18e009 --- /dev/null +++ b/clickhouse/Dockerfile @@ -0,0 +1,14 @@ +FROM clickhouse/clickhouse-server:24.1.2.1 + +# Set environment variables +ENV CLICKHOUSE_CONFIG=/etc/clickhouse-server/config.xml +ENV CLICKHOUSE_USER_CONFIG=/etc/clickhouse-server/users.xml + +# Copy custom configuration file +COPY config.yaml /etc/clickhouse-server/config.yaml + +# Expose ClickHouse ports +EXPOSE 8123 9000 9009 + +# Set the default command +CMD ["clickhouse-server"] \ No newline at end of file diff --git a/clickhouse/clickhouse_import.py b/clickhouse/clickhouse_import.py new file mode 100644 index 00000000..44b8b60a --- /dev/null +++ b/clickhouse/clickhouse_import.py @@ -0,0 +1,83 @@ +import clickhouse_connect +from clickhouse_connect.driver.asyncclient import AsyncClient +import argparse +import os +import asyncio +import time + +BASE_PATH = "/var/lib/clickhouse/user_files/parquet-data-indexers" + + +def get_event_list(network: str) -> set[str]: + event_list = set() + for root, dirs, files in os.walk(f"/parquet-data-indexers/{network}"): + for file in files: + if file.endswith(".parquet"): + event_name = file.split(".")[0] + event_list.add(event_name) + print(f"Found {len(event_list)} events for {network}") + return event_list + + +async def create_table( + client: AsyncClient, + event_name: str, + network: str, +): + print(event_name) + print(f"{BASE_PATH}/{network}/*/{event_name}.parquet") + query = ( + f"create table if not exists {event_name}_{network} " + f"engine = MergeTree order by tuple() as " + f"select * from file('{BASE_PATH}/{network}/*/{event_name}.parquet')" + ) + await client.command(query) + + +async def semaphore_wrapper( + client: AsyncClient, + sm: asyncio.Semaphore, + event_name: str, + network: str, +): + print(event_name) + print(f"{BASE_PATH}/{network}/*/{event_name}.parquet") + async with sm: + data = await client.query( + f"select * from file('{BASE_PATH}/{network}/*/{event_name}.parquet', 'Parquet')" + ) + await client.insert( + f"{event_name}_{network}", + data.result_rows, + settings={"async_insert": 1, "wait_for_async_insert": 1}, + ) + + +async def main(network: str): + client = await clickhouse_connect.get_async_client( + host="clickhouse", port=8123, user="default" + ) + + event_list = get_event_list(network) + + for event_name in event_list: + await create_table(client, event_name, network) + + semaphore = asyncio.Semaphore(4) + + start_time = time.time() + await asyncio.gather( + *[ + semaphore_wrapper(client, semaphore, event_name, network) + for event_name in event_list + ] + ) + end_time = time.time() + print(f"Elapsed time: {end_time-start_time:.2f} seconds") + + +if __name__ == "__main__": + arg = argparse.ArgumentParser() + arg.add_argument("--network", type=str, required=True) + args = arg.parse_args() + asyncio.run(main(args.network)) diff --git a/clickhouse/config.yaml b/clickhouse/config.yaml new file mode 100644 index 00000000..e69de29b diff --git a/clickhouse/requirements.txt b/clickhouse/requirements.txt new file mode 100644 index 00000000..c6e2e962 --- /dev/null +++ b/clickhouse/requirements.txt @@ -0,0 +1 @@ +clickhouse-connect \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 63a9616f..0924f9bf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,26 @@ version: "2.4" services: + clickhouse: + image: clickhouse/clickhouse-server:latest + container_name: clickhouse + networks: + - data + ulimits: + nofile: + soft: 262144 + hard: 262144 + volumes: + - ./parquet-data-indexers:/var/lib/clickhouse/user_files/parquet-data-indexers + ports: + - 8123:8123 + - 9000:9000 + - 9009:9009 + deploy: + resources: + limits: + cpus: "4.0" + memory: 8192M db: build: context: ./postgres @@ -19,6 +39,7 @@ services: - ./postgres/initdb:/docker-entrypoint-initdb.d - ./postgres-data:/var/lib/postgresql/data - ./parquet-data:/parquet-data + - ./parquet-data-indexers:/parquet-data-indexers ports: - "${DB_PORT}:5432" deploy: @@ -80,16 +101,12 @@ services: context: ./indexers/arbitrum-sepolia networks: - data - depends_on: - - db restart: always environment: - DB_HOST: db - DB_PORT: 5432 - DB_NAME: arbitrum_sepolia - DB_PASS: $PG_PASSWORD GQL_PORT: 4350 RPC_ENDPOINT: https://sepolia-rollup.arbitrum.io/rpc + volumes: + - ./parquet-data-indexers:/parquet-data-indexers arbitrum-mainnet-processor: build: @@ -167,6 +184,7 @@ services: volumes: - ./parquet-data:/parquet-data - ./transformers/synthetix:/app/synthetix + - ./parquet-data-indexers:/parquet-data-indexers networks: - data @@ -218,6 +236,8 @@ services: - ./scheduler/plugins:/opt/airflow/plugins - /var/run/docker.sock:/var/run/docker.sock - ./parquet-data:/parquet-data + - ./parquet-data-indexers:/parquet-data-indexers + - ./clickhouse:/clickhouse ports: - "${AIRFLOW_PORT}:8080" diff --git a/indexers/arbitrum-sepolia/Dockerfile b/indexers/arbitrum-sepolia/Dockerfile index 4baf01f6..8f7be5de 100644 --- a/indexers/arbitrum-sepolia/Dockerfile +++ b/indexers/arbitrum-sepolia/Dockerfile @@ -4,11 +4,11 @@ WORKDIR /app COPY package*.json ./ +RUN npm install RUN npm ci COPY . . -RUN npm run generate:processor RUN npm run build -CMD npm run generate:migration ; npm run start +CMD npm run start diff --git a/indexers/arbitrum-sepolia/commands.json b/indexers/arbitrum-sepolia/commands.json index 38ce1c3c..ae8b681d 100644 --- a/indexers/arbitrum-sepolia/commands.json +++ b/indexers/arbitrum-sepolia/commands.json @@ -5,77 +5,25 @@ "description": "delete all build artifacts", "cmd": ["npx", "--yes", "rimraf", "lib"] }, - "generate": { - "description": "Generate a squid from an ABI file", - "cmd": ["squid-gen-abi"] - }, - "squid-gen-abi": { - "description": "Generate a squid from an ABI file", - "cmd": ["squid-gen-abi"], - "hidden": true - }, "build": { "description": "Build the squid project", "deps": ["clean"], "cmd": ["tsc"] }, - "up": { - "description": "Start a PG database", - "cmd": ["docker-compose", "up", "-d"] - }, - "down": { - "description": "Drop a PG database", - "cmd": ["docker-compose", "down"] - }, - "migration:apply": { - "description": "Apply the DB migrations", - "cmd": ["squid-typeorm-migration", "apply"] - }, - "migration:generate": { - "description": "Generate a DB migration matching the TypeORM entities", - "deps": ["build", "migration:clean"], - "cmd": ["squid-typeorm-migration", "generate"], - }, - "migration:clean": { - "description": "Clean the migrations folder", - "cmd": ["npx", "--yes", "rimraf", "./db/migrations"], - }, - "migration": { - "deps": ["build"], - "cmd": ["squid-typeorm-migration", "generate"], - "hidden": true - }, - "codegen": { - "description": "Generate TypeORM entities from the schema file", - "cmd": ["squid-typeorm-codegen"] - }, "typegen": { "description": "Generate data access classes for an ABI file(s) in the ./abi folder", "cmd": ["squid-evm-typegen", "./src/abi", {"glob": "./abi/*.json"}, "--multicall"] }, "process": { "description": "Load .env and start the squid processor", - "deps": ["build", "migration:apply"], + "deps": ["build"], "cmd": ["node", "--require=dotenv/config", "lib/main.js"] }, "process:prod": { "description": "Start the squid processor", - "deps": ["migration:apply"], "cmd": ["node", "lib/main.js"], "hidden": true }, - "serve": { - "description": "Start the GraphQL API server", - "cmd": ["squid-graphql-server"] - }, - "serve:prod": { - "description": "Start the GraphQL API server with caching and limits", - "cmd": ["squid-graphql-server", - "--dumb-cache", "in-memory", - "--dumb-cache-ttl", "1000", - "--dumb-cache-size", "100", - "--dumb-cache-max-age", "1000" ] - }, "check-updates": { "cmd": ["npx", "--yes", "npm-check-updates", "--filter=/subsquid/", "--upgrade"], "hidden": true @@ -84,10 +32,6 @@ "description": "Bump @subsquid packages to the latest versions", "deps": ["check-updates"], "cmd": ["npm", "i", "-f"] - }, - "open": { - "description": "Open a local browser window", - "cmd": ["npx", "--yes", "opener"] } } } diff --git a/indexers/arbitrum-sepolia/package-lock.json b/indexers/arbitrum-sepolia/package-lock.json index 2e1987ec..ae83a5ef 100644 --- a/indexers/arbitrum-sepolia/package-lock.json +++ b/indexers/arbitrum-sepolia/package-lock.json @@ -1,17 +1,15 @@ { - "name": "base-goerli", + "name": "arbitrum-sepolia", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "base-goerli", + "name": "arbitrum-sepolia", "dependencies": { "@subsquid/archive-registry": "^3.0.0", "@subsquid/evm-processor": "^1.5.1", + "@subsquid/file-store-parquet": "^1.1.1", "@subsquid/graphql-server": "^4.2.0", - "@subsquid/typeorm-migration": "^1.2.0", - "@subsquid/typeorm-store": "^1.2.0", - "@subsquid/util-internal-json": "^1.2.0", "dotenv": "^16.1.4", "ethers": "^6.5.1", "pg": "^8.11.0", @@ -679,6 +677,201 @@ "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==", "dev": true }, + "node_modules/@napi-rs/snappy-android-arm-eabi": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-android-arm-eabi/-/snappy-android-arm-eabi-7.2.2.tgz", + "integrity": "sha512-H7DuVkPCK5BlAr1NfSU8bDEN7gYs+R78pSHhDng83QxRnCLmVIZk33ymmIwurmoA1HrdTxbkbuNl+lMvNqnytw==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/snappy-android-arm64": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-android-arm64/-/snappy-android-arm64-7.2.2.tgz", + "integrity": "sha512-2R/A3qok+nGtpVK8oUMcrIi5OMDckGYNoBLFyli3zp8w6IArPRfg1yOfVUcHvpUDTo9T7LOS1fXgMOoC796eQw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/snappy-darwin-arm64": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-darwin-arm64/-/snappy-darwin-arm64-7.2.2.tgz", + "integrity": "sha512-USgArHbfrmdbuq33bD5ssbkPIoT7YCXCRLmZpDS6dMDrx+iM7eD2BecNbOOo7/v1eu6TRmQ0xOzeQ6I/9FIi5g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/snappy-darwin-x64": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-darwin-x64/-/snappy-darwin-x64-7.2.2.tgz", + "integrity": "sha512-0APDu8iO5iT0IJKblk2lH0VpWSl9zOZndZKnBYIc+ei1npw2L5QvuErFOTeTdHBtzvUHASB+9bvgaWnQo4PvTQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/snappy-freebsd-x64": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-freebsd-x64/-/snappy-freebsd-x64-7.2.2.tgz", + "integrity": "sha512-mRTCJsuzy0o/B0Hnp9CwNB5V6cOJ4wedDTWEthsdKHSsQlO7WU9W1yP7H3Qv3Ccp/ZfMyrmG98Ad7u7lG58WXA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/snappy-linux-arm-gnueabihf": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-linux-arm-gnueabihf/-/snappy-linux-arm-gnueabihf-7.2.2.tgz", + "integrity": "sha512-v1uzm8+6uYjasBPcFkv90VLZ+WhLzr/tnfkZ/iD9mHYiULqkqpRuC8zvc3FZaJy5wLQE9zTDkTJN1IvUcZ+Vcg==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/snappy-linux-arm64-gnu": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-linux-arm64-gnu/-/snappy-linux-arm64-gnu-7.2.2.tgz", + "integrity": "sha512-LrEMa5pBScs4GXWOn6ZYXfQ72IzoolZw5txqUHVGs8eK4g1HR9HTHhb2oY5ySNaKakG5sOgMsb1rwaEnjhChmQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/snappy-linux-arm64-musl": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-linux-arm64-musl/-/snappy-linux-arm64-musl-7.2.2.tgz", + "integrity": "sha512-3orWZo9hUpGQcB+3aTLW7UFDqNCQfbr0+MvV67x8nMNYj5eAeUtMmUE/HxLznHO4eZ1qSqiTwLbVx05/Socdlw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/snappy-linux-x64-gnu": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-linux-x64-gnu/-/snappy-linux-x64-gnu-7.2.2.tgz", + "integrity": "sha512-jZt8Jit/HHDcavt80zxEkDpH+R1Ic0ssiVCoueASzMXa7vwPJeF4ZxZyqUw4qeSy7n8UUExomu8G8ZbP6VKhgw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/snappy-linux-x64-musl": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-linux-x64-musl/-/snappy-linux-x64-musl-7.2.2.tgz", + "integrity": "sha512-Dh96IXgcZrV39a+Tej/owcd9vr5ihiZ3KRix11rr1v0MWtVb61+H1GXXlz6+Zcx9y8jM1NmOuiIuJwkV4vZ4WA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/snappy-win32-arm64-msvc": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-win32-arm64-msvc/-/snappy-win32-arm64-msvc-7.2.2.tgz", + "integrity": "sha512-9No0b3xGbHSWv2wtLEn3MO76Yopn1U2TdemZpCaEgOGccz1V+a/1d16Piz3ofSmnA13HGFz3h9NwZH9EOaIgYA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/snappy-win32-ia32-msvc": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-win32-ia32-msvc/-/snappy-win32-ia32-msvc-7.2.2.tgz", + "integrity": "sha512-QiGe+0G86J74Qz1JcHtBwM3OYdTni1hX1PFyLRo3HhQUSpmi13Bzc1En7APn+6Pvo7gkrcy81dObGLDSxFAkQQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@napi-rs/snappy-win32-x64-msvc": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-win32-x64-msvc/-/snappy-win32-x64-msvc-7.2.2.tgz", + "integrity": "sha512-a43cyx1nK0daw6BZxVcvDEXxKMFLSBSDTAhsFD0VqSKcC7MGUBMaqyoWUcMiI7LBSz4bxUmxDWKfCYzpEmeb3w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@noble/curves": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", @@ -1868,6 +2061,14 @@ "squid-archive-registry": "bin/run.js" } }, + "node_modules/@subsquid/big-decimal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/big-decimal/-/big-decimal-1.0.0.tgz", + "integrity": "sha512-/wyZEYC4Mlcm7jQWGhZnCvYpIosRmDSlNbv9SJBphE88aaFe8bOxl4sYwM/olzJgCn4Ir45nBsPU0ebF1+nXog==", + "dependencies": { + "big.js": "~6.2.1" + } + }, "node_modules/@subsquid/cli": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/@subsquid/cli/-/cli-2.6.1.tgz", @@ -1969,6 +2170,19 @@ } } }, + "node_modules/@subsquid/evm-processor/node_modules/@subsquid/util-internal-processor-tools": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-processor-tools/-/util-internal-processor-tools-3.1.0.tgz", + "integrity": "sha512-uEa8Bw/xvSfiagbK8IFt1OEgR7hacfblPZXH5EV4cAIKoIVOonhnkJEPRWqI3ZaDHl+8Z9p909tlsEd46sXenw==", + "dependencies": { + "@subsquid/logger": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-counters": "^1.3.1", + "@subsquid/util-internal-prometheus-server": "^1.2.1", + "@subsquid/util-internal-range": "^0.0.1", + "prom-client": "^14.2.0" + } + }, "node_modules/@subsquid/evm-typegen": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/@subsquid/evm-typegen/-/evm-typegen-3.2.3.tgz", @@ -2024,6 +2238,57 @@ "node": ">=16" } }, + "node_modules/@subsquid/file-store": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/file-store/-/file-store-2.0.0.tgz", + "integrity": "sha512-LlBz8BVF0LxjOs320VygUwRKY7lUdv3UV2e6nhbKurCUyBHvTSJMmVT07DHkAB/RNTqGA5NvSSZnYTEM22y0qA==", + "peer": true, + "dependencies": { + "@subsquid/logger": "~1.3.1", + "@subsquid/util-internal": "^2.5.0", + "upath": "^2.0.1" + }, + "peerDependencies": { + "@subsquid/util-internal-processor-tools": "^2.0.0" + } + }, + "node_modules/@subsquid/file-store-parquet": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@subsquid/file-store-parquet/-/file-store-parquet-1.1.1.tgz", + "integrity": "sha512-zrS4CgHydMsMplMtEHvs8cYF3qv6wYubmnmsRklOkUXx+SN9AfQpqrxrNcJTfHiKzCobaAXJ3JLRJcoL0HDFXQ==", + "dependencies": { + "@subsquid/big-decimal": "^1.0.0", + "@subsquid/util-internal-json": "^1.2.0", + "bson": "^5.4.0", + "lz4": "^0.6.5", + "lzo": "^0.4.11", + "node-int64": "^0.4.0", + "snappy": "^7.2.2", + "thrift": "^0.18.1", + "varint": "^6.0.0", + "zstd.ts": "^1.1.3" + }, + "peerDependencies": { + "@subsquid/file-store": "^2.0.0" + } + }, + "node_modules/@subsquid/file-store/node_modules/@subsquid/logger": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@subsquid/logger/-/logger-1.3.3.tgz", + "integrity": "sha512-BdoRVIOrIRzKdMZPoJxzJzPLulf5Q09GeLtJn0whP+rhDV5nQ4ANDAzjPg9jmgH9WkMYAr2XH4lny/4PjhQUNA==", + "peer": true, + "dependencies": { + "@subsquid/util-internal-hex": "^1.2.2", + "@subsquid/util-internal-json": "^1.2.2", + "supports-color": "^8.1.1" + } + }, + "node_modules/@subsquid/file-store/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "peer": true + }, "node_modules/@subsquid/graphiql-console": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@subsquid/graphiql-console/-/graphiql-console-0.3.0.tgz", @@ -2332,58 +2597,6 @@ } } }, - "node_modules/@subsquid/typeorm-migration": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-migration/-/typeorm-migration-1.2.2.tgz", - "integrity": "sha512-G22Eh7AuPHjLB7C30XNT+fVe2bGYmYI2EB/8Sf5kYfS0yCKvev2YWJNcvkyD6eswv8HgrekwEoj3BKjR5wH6yg==", - "dependencies": { - "@subsquid/typeorm-config": "^3.3.1", - "@subsquid/util-internal": "^2.5.2", - "@subsquid/util-internal-code-printer": "^1.2.1", - "commander": "^11.0.0", - "dotenv": "^16.3.1" - }, - "bin": { - "squid-typeorm-migration": "bin/squid-typeorm-migration", - "squid-typeorm-migration-apply": "bin/squid-typeorm-migration-apply", - "squid-typeorm-migration-create": "bin/squid-typeorm-migration-create", - "squid-typeorm-migration-generate": "bin/squid-typeorm-migration-generate", - "squid-typeorm-migration-revert": "bin/squid-typeorm-migration-revert" - }, - "peerDependencies": { - "typeorm": "^0.3.17" - } - }, - "node_modules/@subsquid/typeorm-migration/node_modules/@subsquid/util-internal": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", - "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" - }, - "node_modules/@subsquid/typeorm-migration/node_modules/commander": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", - "engines": { - "node": ">=16" - } - }, - "node_modules/@subsquid/typeorm-store": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-store/-/typeorm-store-1.2.4.tgz", - "integrity": "sha512-fcHp9cHEe1T1tVjV125CLbNjs/NIQKFW8bdK/stDn9prxuuwfiAGKvpztU52dKVuyQCUFL+8YTtFt2y1i7ZEBA==", - "dependencies": { - "@subsquid/typeorm-config": "^3.3.1", - "@subsquid/util-internal": "^2.5.2" - }, - "peerDependencies": { - "typeorm": "^0.3.17" - } - }, - "node_modules/@subsquid/typeorm-store/node_modules/@subsquid/util-internal": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", - "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" - }, "node_modules/@subsquid/util-internal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-1.1.0.tgz", @@ -2397,7 +2610,8 @@ "node_modules/@subsquid/util-internal-code-printer": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@subsquid/util-internal-code-printer/-/util-internal-code-printer-1.2.1.tgz", - "integrity": "sha512-9l0kCm50hQfRjzplIZs9kHooqxczG82fzAexlD6x1SjdLDU1NfYA0uGxgE6pweKydgd7LCb9ICc5gfDvbWtdaw==" + "integrity": "sha512-9l0kCm50hQfRjzplIZs9kHooqxczG82fzAexlD6x1SjdLDU1NfYA0uGxgE6pweKydgd7LCb9ICc5gfDvbWtdaw==", + "dev": true }, "node_modules/@subsquid/util-internal-config": { "version": "1.0.1", @@ -2415,9 +2629,9 @@ "integrity": "sha512-bc22t8lEvoCBn31F+B763E81+ZDaL7ufpwr0VLXZzcA5wZ6NEqqRfs4bJtPeBNGEjyeLLrItXWxfjSkR7sGKAg==" }, "node_modules/@subsquid/util-internal-hex": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-hex/-/util-internal-hex-1.2.1.tgz", - "integrity": "sha512-R7TYDsftjguapzWia97WGvcF4s65VKArzSga5i1i4aZSq9Z330kPYpgAUkqDGsJqD/Ki3PTE4cXhuKLRyMHPvg==" + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-hex/-/util-internal-hex-1.2.2.tgz", + "integrity": "sha512-E43HVqf23jP5hvtWF9GsiN8luANjnJ1daR2SVTwaIUAYU/uNjv1Bi6tHz2uexlflBhyxAgBDmHgunXZ45wQTIw==" }, "node_modules/@subsquid/util-internal-http-server": { "version": "1.2.1", @@ -2428,23 +2642,24 @@ } }, "node_modules/@subsquid/util-internal-json": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-json/-/util-internal-json-1.2.1.tgz", - "integrity": "sha512-Jtbhur/QaRk727fiZ/w8so0M0o4BIkfvnT6zBnC3s1mQ9fKve0Q6aj22gbimpX7Whj6tAGF0Bz8LFhbAethbkA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-json/-/util-internal-json-1.2.3.tgz", + "integrity": "sha512-H5qW5kG20IzVMpb7GhPbVRxGuACEf1DPIXE1+LNXYxt8t/GX4zQREQWHRvCB3lck+RORLJD3WJbQUtxN5UYB3Q==", "dependencies": { - "@subsquid/util-internal-hex": "^1.2.1" + "@subsquid/util-internal-hex": "^1.2.2" } }, "node_modules/@subsquid/util-internal-processor-tools": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-processor-tools/-/util-internal-processor-tools-3.1.0.tgz", - "integrity": "sha512-uEa8Bw/xvSfiagbK8IFt1OEgR7hacfblPZXH5EV4cAIKoIVOonhnkJEPRWqI3ZaDHl+8Z9p909tlsEd46sXenw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-processor-tools/-/util-internal-processor-tools-2.0.0.tgz", + "integrity": "sha512-QEeCoXZ9/OvLKytVW9tGTxOb2h1NxW4o9UFteWEEMhsDh11cHQ2TVn+kynQ5OPLIq1cXZZD0NmYGN1pRD11y/Q==", + "peer": true, "dependencies": { - "@subsquid/logger": "^1.3.1", - "@subsquid/util-internal": "^2.5.2", - "@subsquid/util-internal-counters": "^1.3.1", - "@subsquid/util-internal-prometheus-server": "^1.2.1", - "@subsquid/util-internal-range": "^0.0.1", + "@subsquid/logger": "^1.3.0", + "@subsquid/util-internal": "^2.4.0", + "@subsquid/util-internal-counters": "^1.3.0", + "@subsquid/util-internal-prometheus-server": "^1.2.0", + "@subsquid/util-internal-range": "^0.0.0", "prom-client": "^14.2.0" } }, @@ -2452,6 +2667,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/@subsquid/logger/-/logger-1.3.1.tgz", "integrity": "sha512-OBhelb0HbhqSygq/IxEm9PPX8thQSDiCPV45UlCqWOoQ9UpiROiQLL+2nwt+HAHQq+LlHTzQmGXV43eabrTfwQ==", + "peer": true, "dependencies": { "@subsquid/util-internal-hex": "^1.2.1", "@subsquid/util-internal-json": "^1.2.1", @@ -2461,7 +2677,18 @@ "node_modules/@subsquid/util-internal-processor-tools/node_modules/@subsquid/util-internal": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", - "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "peer": true + }, + "node_modules/@subsquid/util-internal-processor-tools/node_modules/@subsquid/util-internal-range": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-range/-/util-internal-range-0.0.0.tgz", + "integrity": "sha512-faj70/0jk/of0VFIbrVUlzRPEGNWZTApwetBF0EP1UfW09349Q5LowqCtbuC0TYHQtnm7Qvz5rBG5K0bFGI8Lw==", + "peer": true, + "dependencies": { + "@subsquid/util-internal": "^2.4.0", + "@subsquid/util-internal-binary-heap": "^1.0.0" + } }, "node_modules/@subsquid/util-internal-prometheus-server": { "version": "1.2.1", @@ -2606,32 +2833,6 @@ "jsonc-parser": "^3.2.0" } }, - "node_modules/@troy_/squid-gen-evm/node_modules/@subsquid/util-internal-processor-tools": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-processor-tools/-/util-internal-processor-tools-2.0.0.tgz", - "integrity": "sha512-QEeCoXZ9/OvLKytVW9tGTxOb2h1NxW4o9UFteWEEMhsDh11cHQ2TVn+kynQ5OPLIq1cXZZD0NmYGN1pRD11y/Q==", - "dev": true, - "peer": true, - "dependencies": { - "@subsquid/logger": "^1.3.0", - "@subsquid/util-internal": "^2.4.0", - "@subsquid/util-internal-counters": "^1.3.0", - "@subsquid/util-internal-prometheus-server": "^1.2.0", - "@subsquid/util-internal-range": "^0.0.0", - "prom-client": "^14.2.0" - } - }, - "node_modules/@troy_/squid-gen-evm/node_modules/@subsquid/util-internal-range": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-range/-/util-internal-range-0.0.0.tgz", - "integrity": "sha512-faj70/0jk/of0VFIbrVUlzRPEGNWZTApwetBF0EP1UfW09349Q5LowqCtbuC0TYHQtnm7Qvz5rBG5K0bFGI8Lw==", - "dev": true, - "peer": true, - "dependencies": { - "@subsquid/util-internal": "^2.4.0", - "@subsquid/util-internal-binary-heap": "^1.0.0" - } - }, "node_modules/@troy_/squid-gen-evm/node_modules/commander": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", @@ -3412,6 +3613,11 @@ "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", "dev": true }, + "node_modules/async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" + }, "node_modules/async-retry": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", @@ -3519,6 +3725,18 @@ "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", "dev": true }, + "node_modules/big.js": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-6.2.2.tgz", + "integrity": "sha512-y/ie+Faknx7sZA5MfGA2xKlu0GDv8RWrXGsmlteyJQ2lvoKv9GBK/fpRMc2qlSoBAgNxrixICFCBefIq8WCQpQ==", + "engines": { + "node": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/bigjs" + } + }, "node_modules/bin-links": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.3.tgz", @@ -3570,6 +3788,11 @@ "url": "https://bevry.me/fund" } }, + "node_modules/bindings": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz", + "integrity": "sha512-u4cBQNepWxYA55FunZSM7wMi55yQaN0otnhhilNoWHq0MfOfJeQx0v0mRRpolGOExPjZcl6FtB0BB8Xkb88F0g==" + }, "node_modules/bintrees": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", @@ -3781,6 +4004,19 @@ "integrity": "sha512-wbMxoJJM1p3+6G7xEFXYNCJ30h2qkwmVxebkbwIl4OcnWtno5R3UT9VuYLfStlVNAQCmRjkGwjPFdfaPd4iNXw==", "dev": true }, + "node_modules/browser-or-node": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-1.3.0.tgz", + "integrity": "sha512-0F2z/VSnLbmEeBcUrSuDH5l0HxTXdQQzLjkmBR4cYfvg1zJrKSlmIZFqyFR8oX0NrwPhy3c3HQ6i3OxMbew4Tg==" + }, + "node_modules/bson": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/bson/-/bson-5.5.1.tgz", + "integrity": "sha512-ix0EwukN2EpC0SRWIj/7B5+A6uQMQy6KMREI9qQqvgpkV2frH63T0UDVd1SYedL6dNCmDBYB3QtXi4ISk9YT+g==", + "engines": { + "node": ">=14.20.1" + } + }, "node_modules/buffer": { "version": "4.9.2", "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", @@ -4521,6 +4757,11 @@ "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" }, + "node_modules/cuint": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cuint/-/cuint-0.2.2.tgz", + "integrity": "sha512-d4ZVpCW31eWwCMe1YT3ur7mUDnTXbgwyzaL320DrcRT45rfjYxkt5QWLrmOJ+/UEAI2+fQgKe/fCjR8l4TpRgw==" + }, "node_modules/d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -6209,8 +6450,7 @@ "node_modules/ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, "node_modules/ignore": { "version": "5.3.0", @@ -6804,6 +7044,14 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "peerDependencies": { + "ws": "*" + } + }, "node_modules/jackspeak": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", @@ -7151,17 +7399,64 @@ "url": "https://tidelift.com/funding/github/npm/loglevel" } }, - "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "node_modules/lru-cache": { - "version": "7.13.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.1.tgz", - "integrity": "sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ==", - "engines": { - "node": ">=12" + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "node_modules/lru-cache": { + "version": "7.13.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.1.tgz", + "integrity": "sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ==", + "engines": { + "node": ">=12" + } + }, + "node_modules/lz4": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/lz4/-/lz4-0.6.5.tgz", + "integrity": "sha512-KSZcJU49QZOlJSItaeIU3p8WoAvkTmD9fJqeahQXNu1iQ/kR0/mQLdbrK8JY9MY8f6AhJoMrihp1nu1xDbscSQ==", + "hasInstallScript": true, + "dependencies": { + "buffer": "^5.2.1", + "cuint": "^0.2.2", + "nan": "^2.13.2", + "xxhashjs": "^0.2.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/lz4/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "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": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/lzo": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/lzo/-/lzo-0.4.11.tgz", + "integrity": "sha512-apQHNoW2Alg72FMqaC/7pn03I7umdgSVFt2KRkCXXils4Z9u3QBh1uOtl2O5WmZIDLd9g6Lu4lIdOLmiSTFVCQ==", + "hasInstallScript": true, + "dependencies": { + "bindings": "~1.2.1" } }, "node_modules/make-dir": { @@ -7734,6 +8029,11 @@ "thenify-all": "^1.0.0" } }, + "node_modules/nan": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.20.0.tgz", + "integrity": "sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw==" + }, "node_modules/natural-orderby": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/natural-orderby/-/natural-orderby-2.0.3.tgz", @@ -7986,6 +8286,11 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==" + }, "node_modules/nopt": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.1.2.tgz", @@ -9273,6 +9578,16 @@ "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", "dev": true }, + "node_modules/q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", + "deprecated": "You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.\n\n(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)", + "engines": { + "node": ">=0.6.0", + "teleport": ">=0.2.0" + } + }, "node_modules/qqjs": { "version": "0.3.11", "resolved": "https://registry.npmjs.org/qqjs/-/qqjs-0.3.11.tgz", @@ -10656,6 +10971,33 @@ "npm": ">= 3.0.0" } }, + "node_modules/snappy": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/snappy/-/snappy-7.2.2.tgz", + "integrity": "sha512-iADMq1kY0v3vJmGTuKcFWSXt15qYUz7wFkArOrsSg0IFfI3nJqIJvK2/ZbEIndg7erIJLtAVX2nSOqPz7DcwbA==", + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "optionalDependencies": { + "@napi-rs/snappy-android-arm-eabi": "7.2.2", + "@napi-rs/snappy-android-arm64": "7.2.2", + "@napi-rs/snappy-darwin-arm64": "7.2.2", + "@napi-rs/snappy-darwin-x64": "7.2.2", + "@napi-rs/snappy-freebsd-x64": "7.2.2", + "@napi-rs/snappy-linux-arm-gnueabihf": "7.2.2", + "@napi-rs/snappy-linux-arm64-gnu": "7.2.2", + "@napi-rs/snappy-linux-arm64-musl": "7.2.2", + "@napi-rs/snappy-linux-x64-gnu": "7.2.2", + "@napi-rs/snappy-linux-x64-musl": "7.2.2", + "@napi-rs/snappy-win32-arm64-msvc": "7.2.2", + "@napi-rs/snappy-win32-ia32-msvc": "7.2.2", + "@napi-rs/snappy-win32-x64-msvc": "7.2.2" + } + }, "node_modules/socks": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", @@ -11280,6 +11622,29 @@ "node": ">=0.8" } }, + "node_modules/thrift": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/thrift/-/thrift-0.18.1.tgz", + "integrity": "sha512-9FixcJbrFYsqOigzwpHaLAPmaLwQJrCg/StSmslKc2rLZVfwD15yky7UaZfbfLNQD3c/fwUpWXHwS3U8s/7YhA==", + "dependencies": { + "browser-or-node": "^1.2.1", + "isomorphic-ws": "^4.0.1", + "node-int64": "^0.4.0", + "q": "^1.5.0", + "ws": "^5.2.3" + }, + "engines": { + "node": ">= 10.18.0" + } + }, + "node_modules/thrift/node_modules/ws": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.4.tgz", + "integrity": "sha512-fFCejsuC8f9kOSu9FYaOw8CdO68O3h5v0lg4p74o8JqWpwTf9tniOD+nOB78aWoVSS6WptVUmDrp/KPsMVBWFQ==", + "dependencies": { + "async-limiter": "~1.0.0" + } + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -11928,7 +12293,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", - "dev": true, "engines": { "node": ">=4", "yarn": "*" @@ -12028,6 +12392,11 @@ "node": ">=12" } }, + "node_modules/varint": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", + "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==" + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -12407,6 +12776,14 @@ "node": ">=0.4" } }, + "node_modules/xxhashjs": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz", + "integrity": "sha512-AkTuIuVTET12tpsVIQo+ZU6f/qDmKuRUcjaqR+OIvm+aCBsZ95i7UVY5WJ9TMsSaZ0DA2WxoZ4acu0sPH+OKAw==", + "dependencies": { + "cuint": "^0.2.2" + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -13963,6 +14340,11 @@ "engines": { "node": ">=0.10.0" } + }, + "node_modules/zstd.ts": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/zstd.ts/-/zstd.ts-1.1.3.tgz", + "integrity": "sha512-1xlKTD4O/4H2MEQ/McteFAdujc4cHxNZYDRzjxtWfLAimYbPzV7mIa+ZzzJqpN830AuNklVDA6RgHwcop6IZKw==" } }, "dependencies": { @@ -14465,6 +14847,84 @@ "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==", "dev": true }, + "@napi-rs/snappy-android-arm-eabi": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-android-arm-eabi/-/snappy-android-arm-eabi-7.2.2.tgz", + "integrity": "sha512-H7DuVkPCK5BlAr1NfSU8bDEN7gYs+R78pSHhDng83QxRnCLmVIZk33ymmIwurmoA1HrdTxbkbuNl+lMvNqnytw==", + "optional": true + }, + "@napi-rs/snappy-android-arm64": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-android-arm64/-/snappy-android-arm64-7.2.2.tgz", + "integrity": "sha512-2R/A3qok+nGtpVK8oUMcrIi5OMDckGYNoBLFyli3zp8w6IArPRfg1yOfVUcHvpUDTo9T7LOS1fXgMOoC796eQw==", + "optional": true + }, + "@napi-rs/snappy-darwin-arm64": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-darwin-arm64/-/snappy-darwin-arm64-7.2.2.tgz", + "integrity": "sha512-USgArHbfrmdbuq33bD5ssbkPIoT7YCXCRLmZpDS6dMDrx+iM7eD2BecNbOOo7/v1eu6TRmQ0xOzeQ6I/9FIi5g==", + "optional": true + }, + "@napi-rs/snappy-darwin-x64": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-darwin-x64/-/snappy-darwin-x64-7.2.2.tgz", + "integrity": "sha512-0APDu8iO5iT0IJKblk2lH0VpWSl9zOZndZKnBYIc+ei1npw2L5QvuErFOTeTdHBtzvUHASB+9bvgaWnQo4PvTQ==", + "optional": true + }, + "@napi-rs/snappy-freebsd-x64": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-freebsd-x64/-/snappy-freebsd-x64-7.2.2.tgz", + "integrity": "sha512-mRTCJsuzy0o/B0Hnp9CwNB5V6cOJ4wedDTWEthsdKHSsQlO7WU9W1yP7H3Qv3Ccp/ZfMyrmG98Ad7u7lG58WXA==", + "optional": true + }, + "@napi-rs/snappy-linux-arm-gnueabihf": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-linux-arm-gnueabihf/-/snappy-linux-arm-gnueabihf-7.2.2.tgz", + "integrity": "sha512-v1uzm8+6uYjasBPcFkv90VLZ+WhLzr/tnfkZ/iD9mHYiULqkqpRuC8zvc3FZaJy5wLQE9zTDkTJN1IvUcZ+Vcg==", + "optional": true + }, + "@napi-rs/snappy-linux-arm64-gnu": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-linux-arm64-gnu/-/snappy-linux-arm64-gnu-7.2.2.tgz", + "integrity": "sha512-LrEMa5pBScs4GXWOn6ZYXfQ72IzoolZw5txqUHVGs8eK4g1HR9HTHhb2oY5ySNaKakG5sOgMsb1rwaEnjhChmQ==", + "optional": true + }, + "@napi-rs/snappy-linux-arm64-musl": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-linux-arm64-musl/-/snappy-linux-arm64-musl-7.2.2.tgz", + "integrity": "sha512-3orWZo9hUpGQcB+3aTLW7UFDqNCQfbr0+MvV67x8nMNYj5eAeUtMmUE/HxLznHO4eZ1qSqiTwLbVx05/Socdlw==", + "optional": true + }, + "@napi-rs/snappy-linux-x64-gnu": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-linux-x64-gnu/-/snappy-linux-x64-gnu-7.2.2.tgz", + "integrity": "sha512-jZt8Jit/HHDcavt80zxEkDpH+R1Ic0ssiVCoueASzMXa7vwPJeF4ZxZyqUw4qeSy7n8UUExomu8G8ZbP6VKhgw==", + "optional": true + }, + "@napi-rs/snappy-linux-x64-musl": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-linux-x64-musl/-/snappy-linux-x64-musl-7.2.2.tgz", + "integrity": "sha512-Dh96IXgcZrV39a+Tej/owcd9vr5ihiZ3KRix11rr1v0MWtVb61+H1GXXlz6+Zcx9y8jM1NmOuiIuJwkV4vZ4WA==", + "optional": true + }, + "@napi-rs/snappy-win32-arm64-msvc": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-win32-arm64-msvc/-/snappy-win32-arm64-msvc-7.2.2.tgz", + "integrity": "sha512-9No0b3xGbHSWv2wtLEn3MO76Yopn1U2TdemZpCaEgOGccz1V+a/1d16Piz3ofSmnA13HGFz3h9NwZH9EOaIgYA==", + "optional": true + }, + "@napi-rs/snappy-win32-ia32-msvc": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-win32-ia32-msvc/-/snappy-win32-ia32-msvc-7.2.2.tgz", + "integrity": "sha512-QiGe+0G86J74Qz1JcHtBwM3OYdTni1hX1PFyLRo3HhQUSpmi13Bzc1En7APn+6Pvo7gkrcy81dObGLDSxFAkQQ==", + "optional": true + }, + "@napi-rs/snappy-win32-x64-msvc": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/snappy-win32-x64-msvc/-/snappy-win32-x64-msvc-7.2.2.tgz", + "integrity": "sha512-a43cyx1nK0daw6BZxVcvDEXxKMFLSBSDTAhsFD0VqSKcC7MGUBMaqyoWUcMiI7LBSz4bxUmxDWKfCYzpEmeb3w==", + "optional": true + }, "@noble/curves": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", @@ -15483,6 +15943,14 @@ "sync-fetch": "^0.5.2" } }, + "@subsquid/big-decimal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/big-decimal/-/big-decimal-1.0.0.tgz", + "integrity": "sha512-/wyZEYC4Mlcm7jQWGhZnCvYpIosRmDSlNbv9SJBphE88aaFe8bOxl4sYwM/olzJgCn4Ir45nBsPU0ebF1+nXog==", + "requires": { + "big.js": "~6.2.1" + } + }, "@subsquid/cli": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/@subsquid/cli/-/cli-2.6.1.tgz", @@ -15569,6 +16037,19 @@ "@subsquid/util-internal": "^2.5.2", "@subsquid/util-internal-range": "^0.0.1" } + }, + "@subsquid/util-internal-processor-tools": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-processor-tools/-/util-internal-processor-tools-3.1.0.tgz", + "integrity": "sha512-uEa8Bw/xvSfiagbK8IFt1OEgR7hacfblPZXH5EV4cAIKoIVOonhnkJEPRWqI3ZaDHl+8Z9p909tlsEd46sXenw==", + "requires": { + "@subsquid/logger": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-counters": "^1.3.1", + "@subsquid/util-internal-prometheus-server": "^1.2.1", + "@subsquid/util-internal-range": "^0.0.1", + "prom-client": "^14.2.0" + } } } }, @@ -15618,6 +16099,53 @@ } } }, + "@subsquid/file-store": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/file-store/-/file-store-2.0.0.tgz", + "integrity": "sha512-LlBz8BVF0LxjOs320VygUwRKY7lUdv3UV2e6nhbKurCUyBHvTSJMmVT07DHkAB/RNTqGA5NvSSZnYTEM22y0qA==", + "peer": true, + "requires": { + "@subsquid/logger": "~1.3.1", + "@subsquid/util-internal": "^2.5.0", + "upath": "^2.0.1" + }, + "dependencies": { + "@subsquid/logger": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@subsquid/logger/-/logger-1.3.3.tgz", + "integrity": "sha512-BdoRVIOrIRzKdMZPoJxzJzPLulf5Q09GeLtJn0whP+rhDV5nQ4ANDAzjPg9jmgH9WkMYAr2XH4lny/4PjhQUNA==", + "peer": true, + "requires": { + "@subsquid/util-internal-hex": "^1.2.2", + "@subsquid/util-internal-json": "^1.2.2", + "supports-color": "^8.1.1" + } + }, + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "peer": true + } + } + }, + "@subsquid/file-store-parquet": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@subsquid/file-store-parquet/-/file-store-parquet-1.1.1.tgz", + "integrity": "sha512-zrS4CgHydMsMplMtEHvs8cYF3qv6wYubmnmsRklOkUXx+SN9AfQpqrxrNcJTfHiKzCobaAXJ3JLRJcoL0HDFXQ==", + "requires": { + "@subsquid/big-decimal": "^1.0.0", + "@subsquid/util-internal-json": "^1.2.0", + "bson": "^5.4.0", + "lz4": "^0.6.5", + "lzo": "^0.4.11", + "node-int64": "^0.4.0", + "snappy": "^7.2.2", + "thrift": "^0.18.1", + "varint": "^6.0.0", + "zstd.ts": "^1.1.3" + } + }, "@subsquid/graphiql-console": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@subsquid/graphiql-console/-/graphiql-console-0.3.0.tgz", @@ -15873,46 +16401,6 @@ "@subsquid/util-naming": "^1.2.1" } }, - "@subsquid/typeorm-migration": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-migration/-/typeorm-migration-1.2.2.tgz", - "integrity": "sha512-G22Eh7AuPHjLB7C30XNT+fVe2bGYmYI2EB/8Sf5kYfS0yCKvev2YWJNcvkyD6eswv8HgrekwEoj3BKjR5wH6yg==", - "requires": { - "@subsquid/typeorm-config": "^3.3.1", - "@subsquid/util-internal": "^2.5.2", - "@subsquid/util-internal-code-printer": "^1.2.1", - "commander": "^11.0.0", - "dotenv": "^16.3.1" - }, - "dependencies": { - "@subsquid/util-internal": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", - "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" - }, - "commander": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==" - } - } - }, - "@subsquid/typeorm-store": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-store/-/typeorm-store-1.2.4.tgz", - "integrity": "sha512-fcHp9cHEe1T1tVjV125CLbNjs/NIQKFW8bdK/stDn9prxuuwfiAGKvpztU52dKVuyQCUFL+8YTtFt2y1i7ZEBA==", - "requires": { - "@subsquid/typeorm-config": "^3.3.1", - "@subsquid/util-internal": "^2.5.2" - }, - "dependencies": { - "@subsquid/util-internal": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", - "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" - } - } - }, "@subsquid/util-internal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-1.1.0.tgz", @@ -15926,7 +16414,8 @@ "@subsquid/util-internal-code-printer": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@subsquid/util-internal-code-printer/-/util-internal-code-printer-1.2.1.tgz", - "integrity": "sha512-9l0kCm50hQfRjzplIZs9kHooqxczG82fzAexlD6x1SjdLDU1NfYA0uGxgE6pweKydgd7LCb9ICc5gfDvbWtdaw==" + "integrity": "sha512-9l0kCm50hQfRjzplIZs9kHooqxczG82fzAexlD6x1SjdLDU1NfYA0uGxgE6pweKydgd7LCb9ICc5gfDvbWtdaw==", + "dev": true }, "@subsquid/util-internal-config": { "version": "1.0.1", @@ -15944,9 +16433,9 @@ "integrity": "sha512-bc22t8lEvoCBn31F+B763E81+ZDaL7ufpwr0VLXZzcA5wZ6NEqqRfs4bJtPeBNGEjyeLLrItXWxfjSkR7sGKAg==" }, "@subsquid/util-internal-hex": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-hex/-/util-internal-hex-1.2.1.tgz", - "integrity": "sha512-R7TYDsftjguapzWia97WGvcF4s65VKArzSga5i1i4aZSq9Z330kPYpgAUkqDGsJqD/Ki3PTE4cXhuKLRyMHPvg==" + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-hex/-/util-internal-hex-1.2.2.tgz", + "integrity": "sha512-E43HVqf23jP5hvtWF9GsiN8luANjnJ1daR2SVTwaIUAYU/uNjv1Bi6tHz2uexlflBhyxAgBDmHgunXZ45wQTIw==" }, "@subsquid/util-internal-http-server": { "version": "1.2.1", @@ -15957,23 +16446,24 @@ } }, "@subsquid/util-internal-json": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-json/-/util-internal-json-1.2.1.tgz", - "integrity": "sha512-Jtbhur/QaRk727fiZ/w8so0M0o4BIkfvnT6zBnC3s1mQ9fKve0Q6aj22gbimpX7Whj6tAGF0Bz8LFhbAethbkA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-json/-/util-internal-json-1.2.3.tgz", + "integrity": "sha512-H5qW5kG20IzVMpb7GhPbVRxGuACEf1DPIXE1+LNXYxt8t/GX4zQREQWHRvCB3lck+RORLJD3WJbQUtxN5UYB3Q==", "requires": { - "@subsquid/util-internal-hex": "^1.2.1" + "@subsquid/util-internal-hex": "^1.2.2" } }, "@subsquid/util-internal-processor-tools": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-processor-tools/-/util-internal-processor-tools-3.1.0.tgz", - "integrity": "sha512-uEa8Bw/xvSfiagbK8IFt1OEgR7hacfblPZXH5EV4cAIKoIVOonhnkJEPRWqI3ZaDHl+8Z9p909tlsEd46sXenw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-processor-tools/-/util-internal-processor-tools-2.0.0.tgz", + "integrity": "sha512-QEeCoXZ9/OvLKytVW9tGTxOb2h1NxW4o9UFteWEEMhsDh11cHQ2TVn+kynQ5OPLIq1cXZZD0NmYGN1pRD11y/Q==", + "peer": true, "requires": { - "@subsquid/logger": "^1.3.1", - "@subsquid/util-internal": "^2.5.2", - "@subsquid/util-internal-counters": "^1.3.1", - "@subsquid/util-internal-prometheus-server": "^1.2.1", - "@subsquid/util-internal-range": "^0.0.1", + "@subsquid/logger": "^1.3.0", + "@subsquid/util-internal": "^2.4.0", + "@subsquid/util-internal-counters": "^1.3.0", + "@subsquid/util-internal-prometheus-server": "^1.2.0", + "@subsquid/util-internal-range": "^0.0.0", "prom-client": "^14.2.0" }, "dependencies": { @@ -15981,6 +16471,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/@subsquid/logger/-/logger-1.3.1.tgz", "integrity": "sha512-OBhelb0HbhqSygq/IxEm9PPX8thQSDiCPV45UlCqWOoQ9UpiROiQLL+2nwt+HAHQq+LlHTzQmGXV43eabrTfwQ==", + "peer": true, "requires": { "@subsquid/util-internal-hex": "^1.2.1", "@subsquid/util-internal-json": "^1.2.1", @@ -15990,7 +16481,18 @@ "@subsquid/util-internal": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", - "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "peer": true + }, + "@subsquid/util-internal-range": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-range/-/util-internal-range-0.0.0.tgz", + "integrity": "sha512-faj70/0jk/of0VFIbrVUlzRPEGNWZTApwetBF0EP1UfW09349Q5LowqCtbuC0TYHQtnm7Qvz5rBG5K0bFGI8Lw==", + "peer": true, + "requires": { + "@subsquid/util-internal": "^2.4.0", + "@subsquid/util-internal-binary-heap": "^1.0.0" + } } } }, @@ -16112,32 +16614,6 @@ "jsonc-parser": "^3.2.0" } }, - "@subsquid/util-internal-processor-tools": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-processor-tools/-/util-internal-processor-tools-2.0.0.tgz", - "integrity": "sha512-QEeCoXZ9/OvLKytVW9tGTxOb2h1NxW4o9UFteWEEMhsDh11cHQ2TVn+kynQ5OPLIq1cXZZD0NmYGN1pRD11y/Q==", - "dev": true, - "peer": true, - "requires": { - "@subsquid/logger": "^1.3.0", - "@subsquid/util-internal": "^2.4.0", - "@subsquid/util-internal-counters": "^1.3.0", - "@subsquid/util-internal-prometheus-server": "^1.2.0", - "@subsquid/util-internal-range": "^0.0.0", - "prom-client": "^14.2.0" - } - }, - "@subsquid/util-internal-range": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-range/-/util-internal-range-0.0.0.tgz", - "integrity": "sha512-faj70/0jk/of0VFIbrVUlzRPEGNWZTApwetBF0EP1UfW09349Q5LowqCtbuC0TYHQtnm7Qvz5rBG5K0bFGI8Lw==", - "dev": true, - "peer": true, - "requires": { - "@subsquid/util-internal": "^2.4.0", - "@subsquid/util-internal-binary-heap": "^1.0.0" - } - }, "commander": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", @@ -16780,6 +17256,11 @@ "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", "dev": true }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" + }, "async-retry": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", @@ -16857,6 +17338,11 @@ "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", "dev": true }, + "big.js": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-6.2.2.tgz", + "integrity": "sha512-y/ie+Faknx7sZA5MfGA2xKlu0GDv8RWrXGsmlteyJQ2lvoKv9GBK/fpRMc2qlSoBAgNxrixICFCBefIq8WCQpQ==" + }, "bin-links": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.3.tgz", @@ -16895,6 +17381,11 @@ "integrity": "sha512-DRxnVbOi/1OgA5pA9EDiRT8gvVYeqfuN7TmPfLyt6cyho3KbHCi3EtDQf39TTmGDrR5dZ9CspdXhPkL/j/WGbg==", "dev": true }, + "bindings": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz", + "integrity": "sha512-u4cBQNepWxYA55FunZSM7wMi55yQaN0otnhhilNoWHq0MfOfJeQx0v0mRRpolGOExPjZcl6FtB0BB8Xkb88F0g==" + }, "bintrees": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", @@ -17070,6 +17561,16 @@ "integrity": "sha512-wbMxoJJM1p3+6G7xEFXYNCJ30h2qkwmVxebkbwIl4OcnWtno5R3UT9VuYLfStlVNAQCmRjkGwjPFdfaPd4iNXw==", "dev": true }, + "browser-or-node": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-1.3.0.tgz", + "integrity": "sha512-0F2z/VSnLbmEeBcUrSuDH5l0HxTXdQQzLjkmBR4cYfvg1zJrKSlmIZFqyFR8oX0NrwPhy3c3HQ6i3OxMbew4Tg==" + }, + "bson": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/bson/-/bson-5.5.1.tgz", + "integrity": "sha512-ix0EwukN2EpC0SRWIj/7B5+A6uQMQy6KMREI9qQqvgpkV2frH63T0UDVd1SYedL6dNCmDBYB3QtXi4ISk9YT+g==" + }, "buffer": { "version": "4.9.2", "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", @@ -17655,6 +18156,11 @@ "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" }, + "cuint": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cuint/-/cuint-0.2.2.tgz", + "integrity": "sha512-d4ZVpCW31eWwCMe1YT3ur7mUDnTXbgwyzaL320DrcRT45rfjYxkt5QWLrmOJ+/UEAI2+fQgKe/fCjR8l4TpRgw==" + }, "d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -18945,8 +19451,7 @@ "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, "ignore": { "version": "5.3.0", @@ -19366,6 +19871,12 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "requires": {} + }, "jackspeak": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", @@ -19658,6 +20169,36 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.1.tgz", "integrity": "sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ==" }, + "lz4": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/lz4/-/lz4-0.6.5.tgz", + "integrity": "sha512-KSZcJU49QZOlJSItaeIU3p8WoAvkTmD9fJqeahQXNu1iQ/kR0/mQLdbrK8JY9MY8f6AhJoMrihp1nu1xDbscSQ==", + "requires": { + "buffer": "^5.2.1", + "cuint": "^0.2.2", + "nan": "^2.13.2", + "xxhashjs": "^0.2.2" + }, + "dependencies": { + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + } + } + }, + "lzo": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/lzo/-/lzo-0.4.11.tgz", + "integrity": "sha512-apQHNoW2Alg72FMqaC/7pn03I7umdgSVFt2KRkCXXils4Z9u3QBh1uOtl2O5WmZIDLd9g6Lu4lIdOLmiSTFVCQ==", + "requires": { + "bindings": "~1.2.1" + } + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -20082,6 +20623,11 @@ "thenify-all": "^1.0.0" } }, + "nan": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.20.0.tgz", + "integrity": "sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw==" + }, "natural-orderby": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/natural-orderby/-/natural-orderby-2.0.3.tgz", @@ -20262,6 +20808,11 @@ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.7.1.tgz", "integrity": "sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg==" }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==" + }, "nopt": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.1.2.tgz", @@ -21242,6 +21793,11 @@ "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", "dev": true }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==" + }, "qqjs": { "version": "0.3.11", "resolved": "https://registry.npmjs.org/qqjs/-/qqjs-0.3.11.tgz", @@ -22285,6 +22841,26 @@ "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", "dev": true }, + "snappy": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/snappy/-/snappy-7.2.2.tgz", + "integrity": "sha512-iADMq1kY0v3vJmGTuKcFWSXt15qYUz7wFkArOrsSg0IFfI3nJqIJvK2/ZbEIndg7erIJLtAVX2nSOqPz7DcwbA==", + "requires": { + "@napi-rs/snappy-android-arm-eabi": "7.2.2", + "@napi-rs/snappy-android-arm64": "7.2.2", + "@napi-rs/snappy-darwin-arm64": "7.2.2", + "@napi-rs/snappy-darwin-x64": "7.2.2", + "@napi-rs/snappy-freebsd-x64": "7.2.2", + "@napi-rs/snappy-linux-arm-gnueabihf": "7.2.2", + "@napi-rs/snappy-linux-arm64-gnu": "7.2.2", + "@napi-rs/snappy-linux-arm64-musl": "7.2.2", + "@napi-rs/snappy-linux-x64-gnu": "7.2.2", + "@napi-rs/snappy-linux-x64-musl": "7.2.2", + "@napi-rs/snappy-win32-arm64-msvc": "7.2.2", + "@napi-rs/snappy-win32-ia32-msvc": "7.2.2", + "@napi-rs/snappy-win32-x64-msvc": "7.2.2" + } + }, "socks": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", @@ -22789,6 +23365,28 @@ "thenify": ">= 3.1.0 < 4" } }, + "thrift": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/thrift/-/thrift-0.18.1.tgz", + "integrity": "sha512-9FixcJbrFYsqOigzwpHaLAPmaLwQJrCg/StSmslKc2rLZVfwD15yky7UaZfbfLNQD3c/fwUpWXHwS3U8s/7YhA==", + "requires": { + "browser-or-node": "^1.2.1", + "isomorphic-ws": "^4.0.1", + "node-int64": "^0.4.0", + "q": "^1.5.0", + "ws": "^5.2.3" + }, + "dependencies": { + "ws": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.4.tgz", + "integrity": "sha512-fFCejsuC8f9kOSu9FYaOw8CdO68O3h5v0lg4p74o8JqWpwTf9tniOD+nOB78aWoVSS6WptVUmDrp/KPsMVBWFQ==", + "requires": { + "async-limiter": "~1.0.0" + } + } + } + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -23204,8 +23802,7 @@ "upath": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", - "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==", - "dev": true + "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==" }, "url": { "version": "0.10.3", @@ -23284,6 +23881,11 @@ "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==" }, + "varint": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", + "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==" + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -23570,6 +24172,14 @@ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" }, + "xxhashjs": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz", + "integrity": "sha512-AkTuIuVTET12tpsVIQo+ZU6f/qDmKuRUcjaqR+OIvm+aCBsZ95i7UVY5WJ9TMsSaZ0DA2WxoZ4acu0sPH+OKAw==", + "requires": { + "cuint": "^0.2.2" + } + }, "y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -24738,6 +25348,11 @@ } } } + }, + "zstd.ts": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/zstd.ts/-/zstd.ts-1.1.3.tgz", + "integrity": "sha512-1xlKTD4O/4H2MEQ/McteFAdujc4cHxNZYDRzjxtWfLAimYbPzV7mIa+ZzzJqpN830AuNklVDA6RgHwcop6IZKw==" } } } diff --git a/indexers/arbitrum-sepolia/package.json b/indexers/arbitrum-sepolia/package.json index 2fbdea7f..2168abf5 100644 --- a/indexers/arbitrum-sepolia/package.json +++ b/indexers/arbitrum-sepolia/package.json @@ -4,16 +4,13 @@ "scripts": { "build": "rm -rf lib/ && tsc", "start": "sqd process", - "generate:processor": "npx squid-gen config squidgen.yaml", - "generate:migration": "sqd migration:generate" + "generate:processor": "npx squid-gen config squidgen.yaml" }, "dependencies": { "@subsquid/archive-registry": "^3.0.0", "@subsquid/evm-processor": "^1.5.1", "@subsquid/graphql-server": "^4.2.0", - "@subsquid/typeorm-migration": "^1.2.0", - "@subsquid/typeorm-store": "^1.2.0", - "@subsquid/util-internal-json": "^1.2.0", + "@subsquid/file-store-parquet": "^1.1.1", "dotenv": "^16.1.4", "ethers": "^6.5.1", "pg": "^8.11.0", @@ -27,4 +24,4 @@ "@types/node": "^18.16.17", "typescript": "~5.1.3" } -} \ No newline at end of file +} diff --git a/indexers/arbitrum-sepolia/squid.yaml b/indexers/arbitrum-sepolia/squid.yaml index 12541abf..85da6fa1 100644 --- a/indexers/arbitrum-sepolia/squid.yaml +++ b/indexers/arbitrum-sepolia/squid.yaml @@ -4,21 +4,5 @@ version: 1 description: A squid indexer generated from an ABI template build: deploy: - addons: - postgres: processor: - cmd: - - node - - lib/main - api: - cmd: - - npx - - squid-graphql-server - - "--dumb-cache" - - in-memory - - "--dumb-cache-ttl" - - "1000" - - "--dumb-cache-size" - - "100" - - "--dumb-cache-max-age" - - "1000" + cmd: [ "node", "lib/processor" ] diff --git a/indexers/arbitrum-sepolia/src/abi/AccountProxy.abi.ts b/indexers/arbitrum-sepolia/src/abi/AccountProxy.abi.ts new file mode 100644 index 00000000..8816fca7 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/abi/AccountProxy.abi.ts @@ -0,0 +1,773 @@ +export const ABI_JSON = [ + { + "type": "error", + "name": "ImplementationIsSterile", + "inputs": [ + { + "type": "address", + "name": "implementation" + } + ] + }, + { + "type": "error", + "name": "NoChange", + "inputs": [] + }, + { + "type": "error", + "name": "NotAContract", + "inputs": [ + { + "type": "address", + "name": "contr" + } + ] + }, + { + "type": "error", + "name": "NotNominated", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "Unauthorized", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "UpgradeSimulationFailed", + "inputs": [] + }, + { + "type": "error", + "name": "ZeroAddress", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "OwnerChanged", + "inputs": [ + { + "type": "address", + "name": "oldOwner", + "indexed": false + }, + { + "type": "address", + "name": "newOwner", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "OwnerNominated", + "inputs": [ + { + "type": "address", + "name": "newOwner", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Upgraded", + "inputs": [ + { + "type": "address", + "name": "self", + "indexed": true + }, + { + "type": "address", + "name": "implementation", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "acceptOwnership", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "getImplementation", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "nominateNewOwner", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newNominatedOwner" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "nominatedOwner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "owner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "renounceNomination", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "simulateUpgradeTo", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newImplementation" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "upgradeTo", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newImplementation" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "AlreadyInitialized", + "inputs": [] + }, + { + "type": "error", + "name": "CannotSelfApprove", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "IndexOverrun", + "inputs": [ + { + "type": "uint256", + "name": "requestedIndex" + }, + { + "type": "uint256", + "name": "length" + } + ] + }, + { + "type": "error", + "name": "InvalidOwner", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "InvalidParameter", + "inputs": [ + { + "type": "string", + "name": "parameter" + }, + { + "type": "string", + "name": "reason" + } + ] + }, + { + "type": "error", + "name": "InvalidTransferRecipient", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "OverflowUint256ToUint128", + "inputs": [] + }, + { + "type": "error", + "name": "TokenAlreadyMinted", + "inputs": [ + { + "type": "uint256", + "name": "id" + } + ] + }, + { + "type": "error", + "name": "TokenDoesNotExist", + "inputs": [ + { + "type": "uint256", + "name": "id" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Approval", + "inputs": [ + { + "type": "address", + "name": "owner", + "indexed": true + }, + { + "type": "address", + "name": "approved", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenId", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "ApprovalForAll", + "inputs": [ + { + "type": "address", + "name": "owner", + "indexed": true + }, + { + "type": "address", + "name": "operator", + "indexed": true + }, + { + "type": "bool", + "name": "approved", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Transfer", + "inputs": [ + { + "type": "address", + "name": "from", + "indexed": true + }, + { + "type": "address", + "name": "to", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenId", + "indexed": true + } + ] + }, + { + "type": "function", + "name": "approve", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "balanceOf", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "holder" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "balance" + } + ] + }, + { + "type": "function", + "name": "burn", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getApproved", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [ + { + "type": "address", + "name": "operator" + } + ] + }, + { + "type": "function", + "name": "initialize", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "string", + "name": "tokenName" + }, + { + "type": "string", + "name": "tokenSymbol" + }, + { + "type": "string", + "name": "uri" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "isApprovedForAll", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "holder" + }, + { + "type": "address", + "name": "operator" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isInitialized", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "mint", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "name", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "ownerOf", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "safeMint", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + }, + { + "type": "bytes", + "name": "data" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "safeTransferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "safeTransferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + }, + { + "type": "bytes", + "name": "data" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setAllowance", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + }, + { + "type": "address", + "name": "spender" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setApprovalForAll", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "operator" + }, + { + "type": "bool", + "name": "approved" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setBaseTokenURI", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "string", + "name": "uri" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "supportsInterface", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes4", + "name": "interfaceId" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "symbol", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "tokenByIndex", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "index" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "tokenOfOwnerByIndex", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "owner" + }, + { + "type": "uint256", + "name": "index" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "tokenURI", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "totalSupply", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "transferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + } +] diff --git a/indexers/arbitrum-sepolia/src/abi/AccountProxy.ts b/indexers/arbitrum-sepolia/src/abi/AccountProxy.ts new file mode 100644 index 00000000..a6b9a03d --- /dev/null +++ b/indexers/arbitrum-sepolia/src/abi/AccountProxy.ts @@ -0,0 +1,185 @@ +import * as ethers from 'ethers' +import {LogEvent, Func, ContractBase} from './abi.support' +import {ABI_JSON} from './AccountProxy.abi' + +export const abi = new ethers.Interface(ABI_JSON); + +export const events = { + OwnerChanged: new LogEvent<([oldOwner: string, newOwner: string] & {oldOwner: string, newOwner: string})>( + abi, '0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c' + ), + OwnerNominated: new LogEvent<([newOwner: string] & {newOwner: string})>( + abi, '0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22' + ), + Upgraded: new LogEvent<([self: string, implementation: string] & {self: string, implementation: string})>( + abi, '0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7' + ), + Approval: new LogEvent<([owner: string, approved: string, tokenId: bigint] & {owner: string, approved: string, tokenId: bigint})>( + abi, '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925' + ), + ApprovalForAll: new LogEvent<([owner: string, operator: string, approved: boolean] & {owner: string, operator: string, approved: boolean})>( + abi, '0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31' + ), + Transfer: new LogEvent<([from: string, to: string, tokenId: bigint] & {from: string, to: string, tokenId: bigint})>( + abi, '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' + ), +} + +export const functions = { + acceptOwnership: new Func<[], {}, []>( + abi, '0x79ba5097' + ), + getImplementation: new Func<[], {}, string>( + abi, '0xaaf10f42' + ), + nominateNewOwner: new Func<[newNominatedOwner: string], {newNominatedOwner: string}, []>( + abi, '0x1627540c' + ), + nominatedOwner: new Func<[], {}, string>( + abi, '0x53a47bb7' + ), + owner: new Func<[], {}, string>( + abi, '0x8da5cb5b' + ), + renounceNomination: new Func<[], {}, []>( + abi, '0x718fe928' + ), + simulateUpgradeTo: new Func<[newImplementation: string], {newImplementation: string}, []>( + abi, '0xc7f62cda' + ), + upgradeTo: new Func<[newImplementation: string], {newImplementation: string}, []>( + abi, '0x3659cfe6' + ), + approve: new Func<[to: string, tokenId: bigint], {to: string, tokenId: bigint}, []>( + abi, '0x095ea7b3' + ), + balanceOf: new Func<[holder: string], {holder: string}, bigint>( + abi, '0x70a08231' + ), + burn: new Func<[tokenId: bigint], {tokenId: bigint}, []>( + abi, '0x42966c68' + ), + getApproved: new Func<[tokenId: bigint], {tokenId: bigint}, string>( + abi, '0x081812fc' + ), + initialize: new Func<[tokenName: string, tokenSymbol: string, uri: string], {tokenName: string, tokenSymbol: string, uri: string}, []>( + abi, '0xa6487c53' + ), + isApprovedForAll: new Func<[holder: string, operator: string], {holder: string, operator: string}, boolean>( + abi, '0xe985e9c5' + ), + isInitialized: new Func<[], {}, boolean>( + abi, '0x392e53cd' + ), + mint: new Func<[to: string, tokenId: bigint], {to: string, tokenId: bigint}, []>( + abi, '0x40c10f19' + ), + name: new Func<[], {}, string>( + abi, '0x06fdde03' + ), + ownerOf: new Func<[tokenId: bigint], {tokenId: bigint}, string>( + abi, '0x6352211e' + ), + safeMint: new Func<[to: string, tokenId: bigint, data: string], {to: string, tokenId: bigint, data: string}, []>( + abi, '0x8832e6e3' + ), + 'safeTransferFrom(address,address,uint256)': new Func<[from: string, to: string, tokenId: bigint], {from: string, to: string, tokenId: bigint}, []>( + abi, '0x42842e0e' + ), + 'safeTransferFrom(address,address,uint256,bytes)': new Func<[from: string, to: string, tokenId: bigint, data: string], {from: string, to: string, tokenId: bigint, data: string}, []>( + abi, '0xb88d4fde' + ), + setAllowance: new Func<[tokenId: bigint, spender: string], {tokenId: bigint, spender: string}, []>( + abi, '0xff53fac7' + ), + setApprovalForAll: new Func<[operator: string, approved: boolean], {operator: string, approved: boolean}, []>( + abi, '0xa22cb465' + ), + setBaseTokenURI: new Func<[uri: string], {uri: string}, []>( + abi, '0x30176e13' + ), + supportsInterface: new Func<[interfaceId: string], {interfaceId: string}, boolean>( + abi, '0x01ffc9a7' + ), + symbol: new Func<[], {}, string>( + abi, '0x95d89b41' + ), + tokenByIndex: new Func<[index: bigint], {index: bigint}, bigint>( + abi, '0x4f6ccce7' + ), + tokenOfOwnerByIndex: new Func<[owner: string, index: bigint], {owner: string, index: bigint}, bigint>( + abi, '0x2f745c59' + ), + tokenURI: new Func<[tokenId: bigint], {tokenId: bigint}, string>( + abi, '0xc87b56dd' + ), + totalSupply: new Func<[], {}, bigint>( + abi, '0x18160ddd' + ), + transferFrom: new Func<[from: string, to: string, tokenId: bigint], {from: string, to: string, tokenId: bigint}, []>( + abi, '0x23b872dd' + ), +} + +export class Contract extends ContractBase { + + getImplementation(): Promise { + return this.eth_call(functions.getImplementation, []) + } + + nominatedOwner(): Promise { + return this.eth_call(functions.nominatedOwner, []) + } + + owner(): Promise { + return this.eth_call(functions.owner, []) + } + + balanceOf(holder: string): Promise { + return this.eth_call(functions.balanceOf, [holder]) + } + + getApproved(tokenId: bigint): Promise { + return this.eth_call(functions.getApproved, [tokenId]) + } + + isApprovedForAll(holder: string, operator: string): Promise { + return this.eth_call(functions.isApprovedForAll, [holder, operator]) + } + + isInitialized(): Promise { + return this.eth_call(functions.isInitialized, []) + } + + name(): Promise { + return this.eth_call(functions.name, []) + } + + ownerOf(tokenId: bigint): Promise { + return this.eth_call(functions.ownerOf, [tokenId]) + } + + supportsInterface(interfaceId: string): Promise { + return this.eth_call(functions.supportsInterface, [interfaceId]) + } + + symbol(): Promise { + return this.eth_call(functions.symbol, []) + } + + tokenByIndex(index: bigint): Promise { + return this.eth_call(functions.tokenByIndex, [index]) + } + + tokenOfOwnerByIndex(owner: string, index: bigint): Promise { + return this.eth_call(functions.tokenOfOwnerByIndex, [owner, index]) + } + + tokenURI(tokenId: bigint): Promise { + return this.eth_call(functions.tokenURI, [tokenId]) + } + + totalSupply(): Promise { + return this.eth_call(functions.totalSupply, []) + } +} diff --git a/indexers/arbitrum-sepolia/src/abi/CoreProxy.abi.ts b/indexers/arbitrum-sepolia/src/abi/CoreProxy.abi.ts new file mode 100644 index 00000000..30b10b02 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/abi/CoreProxy.abi.ts @@ -0,0 +1,4817 @@ +export const ABI_JSON = [ + { + "type": "error", + "name": "ImplementationIsSterile", + "inputs": [ + { + "type": "address", + "name": "implementation" + } + ] + }, + { + "type": "error", + "name": "NoChange", + "inputs": [] + }, + { + "type": "error", + "name": "NotAContract", + "inputs": [ + { + "type": "address", + "name": "contr" + } + ] + }, + { + "type": "error", + "name": "NotNominated", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "Unauthorized", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "UpgradeSimulationFailed", + "inputs": [] + }, + { + "type": "error", + "name": "ZeroAddress", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "OwnerChanged", + "inputs": [ + { + "type": "address", + "name": "oldOwner", + "indexed": false + }, + { + "type": "address", + "name": "newOwner", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "OwnerNominated", + "inputs": [ + { + "type": "address", + "name": "newOwner", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Upgraded", + "inputs": [ + { + "type": "address", + "name": "self", + "indexed": true + }, + { + "type": "address", + "name": "implementation", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "acceptOwnership", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "getImplementation", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "nominateNewOwner", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newNominatedOwner" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "nominatedOwner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "owner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "renounceNomination", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "simulateUpgradeTo", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newImplementation" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "upgradeTo", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newImplementation" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "ValueAlreadyInSet", + "inputs": [] + }, + { + "type": "error", + "name": "ValueNotInSet", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagAllowAllSet", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "bool", + "name": "allowAll", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagAllowlistAdded", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "address", + "name": "account", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagAllowlistRemoved", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "address", + "name": "account", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagDeniersReset", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "address[]", + "name": "deniers" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagDenyAllSet", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "bool", + "name": "denyAll", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "addToFeatureFlagAllowlist", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getDeniers", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + } + ], + "outputs": [ + { + "type": "address[]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getFeatureFlagAllowAll", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getFeatureFlagAllowlist", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + } + ], + "outputs": [ + { + "type": "address[]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getFeatureFlagDenyAll", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isFeatureAllowed", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "removeFromFeatureFlagAllowlist", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setDeniers", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "address[]", + "name": "deniers" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setFeatureFlagAllowAll", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "bool", + "name": "allowAll" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setFeatureFlagDenyAll", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "bool", + "name": "denyAll" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "FeatureUnavailable", + "inputs": [ + { + "type": "bytes32", + "name": "which" + } + ] + }, + { + "type": "error", + "name": "InvalidAccountId", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ] + }, + { + "type": "error", + "name": "InvalidPermission", + "inputs": [ + { + "type": "bytes32", + "name": "permission" + } + ] + }, + { + "type": "error", + "name": "OnlyAccountTokenProxy", + "inputs": [ + { + "type": "address", + "name": "origin" + } + ] + }, + { + "type": "error", + "name": "PermissionDenied", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + }, + { + "type": "address", + "name": "target" + } + ] + }, + { + "type": "error", + "name": "PermissionNotGranted", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + }, + { + "type": "address", + "name": "user" + } + ] + }, + { + "type": "error", + "name": "PositionOutOfBounds", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "AccountCreated", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "address", + "name": "owner", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PermissionGranted", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "bytes32", + "name": "permission", + "indexed": true + }, + { + "type": "address", + "name": "user", + "indexed": true + }, + { + "type": "address", + "name": "sender", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PermissionRevoked", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "bytes32", + "name": "permission", + "indexed": true + }, + { + "type": "address", + "name": "user", + "indexed": true + }, + { + "type": "address", + "name": "sender", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "createAccount", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint128", + "name": "accountId" + } + ] + }, + { + "type": "function", + "name": "createAccount", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "requestedAccountId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getAccountLastInteraction", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getAccountOwner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getAccountPermissions", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "tuple[]", + "name": "accountPerms", + "components": [ + { + "type": "address", + "name": "user" + }, + { + "type": "bytes32[]", + "name": "permissions" + } + ] + } + ] + }, + { + "type": "function", + "name": "getAccountTokenAddress", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "grantPermission", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + }, + { + "type": "address", + "name": "user" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "hasPermission", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + }, + { + "type": "address", + "name": "user" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isAuthorized", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + }, + { + "type": "address", + "name": "user" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "notifyAccountTransfer", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "to" + }, + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "renouncePermission", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "revokePermission", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + }, + { + "type": "address", + "name": "user" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "AccountNotFound", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ] + }, + { + "type": "error", + "name": "EmptyDistribution", + "inputs": [] + }, + { + "type": "error", + "name": "InsufficientCollateralRatio", + "inputs": [ + { + "type": "uint256", + "name": "collateralValue" + }, + { + "type": "uint256", + "name": "debt" + }, + { + "type": "uint256", + "name": "ratio" + }, + { + "type": "uint256", + "name": "minRatio" + } + ] + }, + { + "type": "error", + "name": "MarketNotFound", + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ] + }, + { + "type": "error", + "name": "NotFundedByPool", + "inputs": [ + { + "type": "uint256", + "name": "marketId" + }, + { + "type": "uint256", + "name": "poolId" + } + ] + }, + { + "type": "error", + "name": "OverflowInt256ToInt128", + "inputs": [] + }, + { + "type": "error", + "name": "OverflowInt256ToUint256", + "inputs": [] + }, + { + "type": "error", + "name": "OverflowUint128ToInt128", + "inputs": [] + }, + { + "type": "error", + "name": "OverflowUint256ToInt256", + "inputs": [] + }, + { + "type": "error", + "name": "OverflowUint256ToUint128", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "DebtAssociated", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "uint128", + "name": "accountId", + "indexed": false + }, + { + "type": "uint256", + "name": "amount", + "indexed": false + }, + { + "type": "int256", + "name": "updatedDebt", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "associateDebt", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint256", + "name": "amount" + } + ], + "outputs": [ + { + "type": "int256", + "name": "" + } + ] + }, + { + "type": "error", + "name": "MismatchAssociatedSystemKind", + "inputs": [ + { + "type": "bytes32", + "name": "expected" + }, + { + "type": "bytes32", + "name": "actual" + } + ] + }, + { + "type": "error", + "name": "MissingAssociatedSystem", + "inputs": [ + { + "type": "bytes32", + "name": "id" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "AssociatedSystemSet", + "inputs": [ + { + "type": "bytes32", + "name": "kind", + "indexed": true + }, + { + "type": "bytes32", + "name": "id", + "indexed": true + }, + { + "type": "address", + "name": "proxy", + "indexed": false + }, + { + "type": "address", + "name": "impl", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "getAssociatedSystem", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "id" + } + ], + "outputs": [ + { + "type": "address", + "name": "addr" + }, + { + "type": "bytes32", + "name": "kind" + } + ] + }, + { + "type": "function", + "name": "initOrUpgradeNft", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "id" + }, + { + "type": "string", + "name": "name" + }, + { + "type": "string", + "name": "symbol" + }, + { + "type": "string", + "name": "uri" + }, + { + "type": "address", + "name": "impl" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "initOrUpgradeToken", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "id" + }, + { + "type": "string", + "name": "name" + }, + { + "type": "string", + "name": "symbol" + }, + { + "type": "uint8", + "name": "decimals" + }, + { + "type": "address", + "name": "impl" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "registerUnmanagedSystem", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "id" + }, + { + "type": "address", + "name": "endpoint" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "InvalidMessage", + "inputs": [] + }, + { + "type": "error", + "name": "NotCcipRouter", + "inputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "error", + "name": "UnsupportedNetwork", + "inputs": [ + { + "type": "uint64", + "name": "" + } + ] + }, + { + "type": "function", + "name": "ccipReceive", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "tuple", + "name": "message", + "components": [ + { + "type": "bytes32", + "name": "messageId" + }, + { + "type": "uint64", + "name": "sourceChainSelector" + }, + { + "type": "bytes", + "name": "sender" + }, + { + "type": "bytes", + "name": "data" + }, + { + "type": "tuple[]", + "name": "tokenAmounts", + "components": [ + { + "type": "address", + "name": "token" + }, + { + "type": "uint256", + "name": "amount" + } + ] + } + ] + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "AccountActivityTimeoutPending", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint256", + "name": "currentTime" + }, + { + "type": "uint256", + "name": "requiredTime" + } + ] + }, + { + "type": "error", + "name": "CollateralDepositDisabled", + "inputs": [ + { + "type": "address", + "name": "collateralType" + } + ] + }, + { + "type": "error", + "name": "CollateralNotFound", + "inputs": [] + }, + { + "type": "error", + "name": "FailedTransfer", + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "value" + } + ] + }, + { + "type": "error", + "name": "InsufficentAvailableCollateral", + "inputs": [ + { + "type": "uint256", + "name": "amountAvailableForDelegationD18" + }, + { + "type": "uint256", + "name": "amountD18" + } + ] + }, + { + "type": "error", + "name": "InsufficientAccountCollateral", + "inputs": [ + { + "type": "uint256", + "name": "amount" + } + ] + }, + { + "type": "error", + "name": "InsufficientAllowance", + "inputs": [ + { + "type": "uint256", + "name": "required" + }, + { + "type": "uint256", + "name": "existing" + } + ] + }, + { + "type": "error", + "name": "InvalidParameter", + "inputs": [ + { + "type": "string", + "name": "parameter" + }, + { + "type": "string", + "name": "reason" + } + ] + }, + { + "type": "error", + "name": "OverflowUint256ToUint64", + "inputs": [] + }, + { + "type": "error", + "name": "PrecisionLost", + "inputs": [ + { + "type": "uint256", + "name": "tokenAmount" + }, + { + "type": "uint8", + "name": "decimals" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "CollateralLockCreated", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenAmount", + "indexed": false + }, + { + "type": "uint64", + "name": "expireTimestamp", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "CollateralLockExpired", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenAmount", + "indexed": false + }, + { + "type": "uint64", + "name": "expireTimestamp", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Deposited", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenAmount", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Withdrawn", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenAmount", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "function", + "name": "cleanExpiredLocks", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "offset" + }, + { + "type": "uint256", + "name": "count" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "cleared" + } + ] + }, + { + "type": "function", + "name": "createLock", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "amount" + }, + { + "type": "uint64", + "name": "expireTimestamp" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "deposit", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "tokenAmount" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getAccountAvailableCollateral", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getAccountCollateral", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "totalDeposited" + }, + { + "type": "uint256", + "name": "totalAssigned" + }, + { + "type": "uint256", + "name": "totalLocked" + } + ] + }, + { + "type": "function", + "name": "getLocks", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "offset" + }, + { + "type": "uint256", + "name": "count" + } + ], + "outputs": [ + { + "type": "tuple[]", + "name": "locks", + "components": [ + { + "type": "uint128", + "name": "amountD18" + }, + { + "type": "uint64", + "name": "lockExpirationTime" + } + ] + } + ] + }, + { + "type": "function", + "name": "withdraw", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "tokenAmount" + } + ], + "outputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "CollateralConfigured", + "inputs": [ + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "tuple", + "name": "config", + "indexed": false, + "components": [ + { + "type": "bool", + "name": "depositingEnabled" + }, + { + "type": "uint256", + "name": "issuanceRatioD18" + }, + { + "type": "uint256", + "name": "liquidationRatioD18" + }, + { + "type": "uint256", + "name": "liquidationRewardD18" + }, + { + "type": "bytes32", + "name": "oracleNodeId" + }, + { + "type": "address", + "name": "tokenAddress" + }, + { + "type": "uint256", + "name": "minDelegationD18" + } + ] + } + ] + }, + { + "type": "function", + "name": "configureCollateral", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "tuple", + "name": "config", + "components": [ + { + "type": "bool", + "name": "depositingEnabled" + }, + { + "type": "uint256", + "name": "issuanceRatioD18" + }, + { + "type": "uint256", + "name": "liquidationRatioD18" + }, + { + "type": "uint256", + "name": "liquidationRewardD18" + }, + { + "type": "bytes32", + "name": "oracleNodeId" + }, + { + "type": "address", + "name": "tokenAddress" + }, + { + "type": "uint256", + "name": "minDelegationD18" + } + ] + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getCollateralConfiguration", + "constant": true, + "stateMutability": "pure", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "tuple", + "name": "", + "components": [ + { + "type": "bool", + "name": "depositingEnabled" + }, + { + "type": "uint256", + "name": "issuanceRatioD18" + }, + { + "type": "uint256", + "name": "liquidationRatioD18" + }, + { + "type": "uint256", + "name": "liquidationRewardD18" + }, + { + "type": "bytes32", + "name": "oracleNodeId" + }, + { + "type": "address", + "name": "tokenAddress" + }, + { + "type": "uint256", + "name": "minDelegationD18" + } + ] + } + ] + }, + { + "type": "function", + "name": "getCollateralConfigurations", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bool", + "name": "hideDisabled" + } + ], + "outputs": [ + { + "type": "tuple[]", + "name": "", + "components": [ + { + "type": "bool", + "name": "depositingEnabled" + }, + { + "type": "uint256", + "name": "issuanceRatioD18" + }, + { + "type": "uint256", + "name": "liquidationRatioD18" + }, + { + "type": "uint256", + "name": "liquidationRewardD18" + }, + { + "type": "bytes32", + "name": "oracleNodeId" + }, + { + "type": "address", + "name": "tokenAddress" + }, + { + "type": "uint256", + "name": "minDelegationD18" + } + ] + } + ] + }, + { + "type": "function", + "name": "getCollateralPrice", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "error", + "name": "InsufficientCcipFee", + "inputs": [ + { + "type": "uint256", + "name": "requiredAmount" + }, + { + "type": "uint256", + "name": "availableAmount" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "TransferCrossChainInitiated", + "inputs": [ + { + "type": "uint64", + "name": "destChainId", + "indexed": true + }, + { + "type": "uint256", + "name": "amount", + "indexed": true + }, + { + "type": "address", + "name": "sender", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "transferCrossChain", + "constant": false, + "stateMutability": "payable", + "payable": true, + "inputs": [ + { + "type": "uint64", + "name": "destChainId" + }, + { + "type": "uint256", + "name": "amount" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "gasTokenUsed" + } + ] + }, + { + "type": "error", + "name": "InsufficientDebt", + "inputs": [ + { + "type": "int256", + "name": "currentDebt" + } + ] + }, + { + "type": "error", + "name": "PoolNotFound", + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "IssuanceFeePaid", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": false + }, + { + "type": "uint256", + "name": "feeAmount", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "UsdBurned", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": false + }, + { + "type": "uint256", + "name": "amount", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "UsdMinted", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": false + }, + { + "type": "uint256", + "name": "amount", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "function", + "name": "burnUsd", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "amount" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "mintUsd", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "amount" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "CannotScaleEmptyMapping", + "inputs": [] + }, + { + "type": "error", + "name": "IneligibleForLiquidation", + "inputs": [ + { + "type": "uint256", + "name": "collateralValue" + }, + { + "type": "int256", + "name": "debt" + }, + { + "type": "uint256", + "name": "currentCRatio" + }, + { + "type": "uint256", + "name": "cratio" + } + ] + }, + { + "type": "error", + "name": "InsufficientMappedAmount", + "inputs": [] + }, + { + "type": "error", + "name": "MustBeVaultLiquidated", + "inputs": [] + }, + { + "type": "error", + "name": "OverflowInt128ToUint128", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "Liquidation", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "tuple", + "name": "liquidationData", + "indexed": false, + "components": [ + { + "type": "uint256", + "name": "debtLiquidated" + }, + { + "type": "uint256", + "name": "collateralLiquidated" + }, + { + "type": "uint256", + "name": "amountRewarded" + } + ] + }, + { + "type": "uint128", + "name": "liquidateAsAccountId", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "VaultLiquidation", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "tuple", + "name": "liquidationData", + "indexed": false, + "components": [ + { + "type": "uint256", + "name": "debtLiquidated" + }, + { + "type": "uint256", + "name": "collateralLiquidated" + }, + { + "type": "uint256", + "name": "amountRewarded" + } + ] + }, + { + "type": "uint128", + "name": "liquidateAsAccountId", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "isPositionLiquidatable", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isVaultLiquidatable", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "liquidate", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint128", + "name": "liquidateAsAccountId" + } + ], + "outputs": [ + { + "type": "tuple", + "name": "liquidationData", + "components": [ + { + "type": "uint256", + "name": "debtLiquidated" + }, + { + "type": "uint256", + "name": "collateralLiquidated" + }, + { + "type": "uint256", + "name": "amountRewarded" + } + ] + } + ] + }, + { + "type": "function", + "name": "liquidateVault", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint128", + "name": "liquidateAsAccountId" + }, + { + "type": "uint256", + "name": "maxUsd" + } + ], + "outputs": [ + { + "type": "tuple", + "name": "liquidationData", + "components": [ + { + "type": "uint256", + "name": "debtLiquidated" + }, + { + "type": "uint256", + "name": "collateralLiquidated" + }, + { + "type": "uint256", + "name": "amountRewarded" + } + ] + } + ] + }, + { + "type": "error", + "name": "InsufficientMarketCollateralDepositable", + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "tokenAmountToDeposit" + } + ] + }, + { + "type": "error", + "name": "InsufficientMarketCollateralWithdrawable", + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "tokenAmountToWithdraw" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketCollateralDeposited", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenAmount", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": true + }, + { + "type": "int128", + "name": "creditCapacity", + "indexed": false + }, + { + "type": "int128", + "name": "netIssuance", + "indexed": false + }, + { + "type": "uint256", + "name": "depositedCollateralValue", + "indexed": false + }, + { + "type": "uint256", + "name": "reportedDebt", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketCollateralWithdrawn", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenAmount", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": true + }, + { + "type": "int128", + "name": "creditCapacity", + "indexed": false + }, + { + "type": "int128", + "name": "netIssuance", + "indexed": false + }, + { + "type": "uint256", + "name": "depositedCollateralValue", + "indexed": false + }, + { + "type": "uint256", + "name": "reportedDebt", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MaximumMarketCollateralConfigured", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "uint256", + "name": "systemAmount", + "indexed": false + }, + { + "type": "address", + "name": "owner", + "indexed": true + } + ] + }, + { + "type": "function", + "name": "configureMaximumMarketCollateral", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "amount" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "depositMarketCollateral", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "tokenAmount" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getMarketCollateralAmount", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "collateralAmountD18" + } + ] + }, + { + "type": "function", + "name": "getMarketCollateralValue", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getMaximumMarketCollateral", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "withdrawMarketCollateral", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "tokenAmount" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "IncorrectMarketInterface", + "inputs": [ + { + "type": "address", + "name": "market" + } + ] + }, + { + "type": "error", + "name": "NotEnoughLiquidity", + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "amount" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketRegistered", + "inputs": [ + { + "type": "address", + "name": "market", + "indexed": true + }, + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketSystemFeePaid", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint256", + "name": "feeAmount", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketUsdDeposited", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "address", + "name": "target", + "indexed": true + }, + { + "type": "uint256", + "name": "amount", + "indexed": false + }, + { + "type": "address", + "name": "market", + "indexed": true + }, + { + "type": "int128", + "name": "creditCapacity", + "indexed": false + }, + { + "type": "int128", + "name": "netIssuance", + "indexed": false + }, + { + "type": "uint256", + "name": "depositedCollateralValue", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketUsdWithdrawn", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "address", + "name": "target", + "indexed": true + }, + { + "type": "uint256", + "name": "amount", + "indexed": false + }, + { + "type": "address", + "name": "market", + "indexed": true + }, + { + "type": "int128", + "name": "creditCapacity", + "indexed": false + }, + { + "type": "int128", + "name": "netIssuance", + "indexed": false + }, + { + "type": "uint256", + "name": "depositedCollateralValue", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SetMarketMinLiquidityRatio", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint256", + "name": "minLiquidityRatio", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SetMinDelegateTime", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint32", + "name": "minDelegateTime", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "depositMarketUsd", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "address", + "name": "target" + }, + { + "type": "uint256", + "name": "amount" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "feeAmount" + } + ] + }, + { + "type": "function", + "name": "distributeDebtToPools", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "maxIter" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getMarketAddress", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getMarketCollateral", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getMarketDebtPerShare", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "int256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getMarketFees", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "" + }, + { + "type": "uint256", + "name": "amount" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "depositFeeAmount" + }, + { + "type": "uint256", + "name": "withdrawFeeAmount" + } + ] + }, + { + "type": "function", + "name": "getMarketMinDelegateTime", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getMarketNetIssuance", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "int128", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getMarketPoolDebtDistribution", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "sharesD18" + }, + { + "type": "uint128", + "name": "totalSharesD18" + }, + { + "type": "int128", + "name": "valuePerShareD27" + } + ] + }, + { + "type": "function", + "name": "getMarketPools", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint128[]", + "name": "inRangePoolIds" + }, + { + "type": "uint128[]", + "name": "outRangePoolIds" + } + ] + }, + { + "type": "function", + "name": "getMarketReportedDebt", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getMarketTotalDebt", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "int256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getMinLiquidityRatio", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getOracleManager", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getUsdToken", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getWithdrawableMarketUsd", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isMarketCapacityLocked", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "registerMarket", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "market" + } + ], + "outputs": [ + { + "type": "uint128", + "name": "marketId" + } + ] + }, + { + "type": "function", + "name": "setMarketMinDelegateTime", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint32", + "name": "minDelegateTime" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setMinLiquidityRatio", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "minLiquidityRatio" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "withdrawMarketUsd", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "address", + "name": "target" + }, + { + "type": "uint256", + "name": "amount" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "feeAmount" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PoolApprovedAdded", + "inputs": [ + { + "type": "uint256", + "name": "poolId", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PoolApprovedRemoved", + "inputs": [ + { + "type": "uint256", + "name": "poolId", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PreferredPoolSet", + "inputs": [ + { + "type": "uint256", + "name": "poolId", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "addApprovedPool", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getApprovedPools", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256[]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getPreferredPool", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint128", + "name": "" + } + ] + }, + { + "type": "function", + "name": "removeApprovedPool", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setPreferredPool", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "CapacityLocked", + "inputs": [ + { + "type": "uint256", + "name": "marketId" + } + ] + }, + { + "type": "error", + "name": "MinDelegationTimeoutPending", + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "uint32", + "name": "timeRemaining" + } + ] + }, + { + "type": "error", + "name": "PoolAlreadyExists", + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PoolCollateralConfigurationUpdated", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": false + }, + { + "type": "tuple", + "name": "config", + "indexed": false, + "components": [ + { + "type": "uint256", + "name": "collateralLimitD18" + }, + { + "type": "uint256", + "name": "issuanceRatioD18" + } + ] + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PoolCollateralDisabledByDefaultSet", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": false + }, + { + "type": "bool", + "name": "disabled", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PoolConfigurationSet", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "tuple[]", + "name": "markets", + "components": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "weightD18" + }, + { + "type": "int128", + "name": "maxDebtShareValueD18" + } + ] + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PoolCreated", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "owner", + "indexed": true + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PoolNameUpdated", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "string", + "name": "name", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PoolNominationRenounced", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "owner", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PoolNominationRevoked", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "owner", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PoolOwnerNominated", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "nominatedOwner", + "indexed": true + }, + { + "type": "address", + "name": "owner", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PoolOwnershipAccepted", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "owner", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PoolOwnershipRenounced", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "owner", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SetMinLiquidityRatio", + "inputs": [ + { + "type": "uint256", + "name": "minLiquidityRatio", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "acceptPoolOwnership", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "createPool", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "requestedPoolId" + }, + { + "type": "address", + "name": "owner" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getMinLiquidityRatio", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getNominatedPoolOwner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getPoolCollateralConfiguration", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "tuple", + "name": "config", + "components": [ + { + "type": "uint256", + "name": "collateralLimitD18" + }, + { + "type": "uint256", + "name": "issuanceRatioD18" + } + ] + } + ] + }, + { + "type": "function", + "name": "getPoolCollateralIssuanceRatio", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateral" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getPoolConfiguration", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [ + { + "type": "tuple[]", + "name": "", + "components": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "weightD18" + }, + { + "type": "int128", + "name": "maxDebtShareValueD18" + } + ] + } + ] + }, + { + "type": "function", + "name": "getPoolName", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [ + { + "type": "string", + "name": "poolName" + } + ] + }, + { + "type": "function", + "name": "getPoolOwner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "nominatePoolOwner", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "nominatedOwner" + }, + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "rebalancePool", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "optionalCollateralType" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "renouncePoolNomination", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "renouncePoolOwnership", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "revokePoolNomination", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setMinLiquidityRatio", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "minLiquidityRatio" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setPoolCollateralConfiguration", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "tuple", + "name": "newConfig", + "components": [ + { + "type": "uint256", + "name": "collateralLimitD18" + }, + { + "type": "uint256", + "name": "issuanceRatioD18" + } + ] + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setPoolCollateralDisabledByDefault", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "bool", + "name": "disabled" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setPoolConfiguration", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "tuple[]", + "name": "newMarketConfigurations", + "components": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "weightD18" + }, + { + "type": "int128", + "name": "maxDebtShareValueD18" + } + ] + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setPoolName", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "string", + "name": "name" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "OverflowUint256ToUint32", + "inputs": [] + }, + { + "type": "error", + "name": "OverflowUint32ToInt32", + "inputs": [] + }, + { + "type": "error", + "name": "OverflowUint64ToInt64", + "inputs": [] + }, + { + "type": "error", + "name": "RewardDistributorNotFound", + "inputs": [] + }, + { + "type": "error", + "name": "RewardUnavailable", + "inputs": [ + { + "type": "address", + "name": "distributor" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RewardsClaimed", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "address", + "name": "distributor", + "indexed": false + }, + { + "type": "uint256", + "name": "amount", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RewardsDistributed", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "address", + "name": "distributor", + "indexed": false + }, + { + "type": "uint256", + "name": "amount", + "indexed": false + }, + { + "type": "uint256", + "name": "start", + "indexed": false + }, + { + "type": "uint256", + "name": "duration", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RewardsDistributorRegistered", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "address", + "name": "distributor", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RewardsDistributorRemoved", + "inputs": [ + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": true + }, + { + "type": "address", + "name": "distributor", + "indexed": true + } + ] + }, + { + "type": "function", + "name": "claimRewards", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "address", + "name": "distributor" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "distributeRewards", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "amount" + }, + { + "type": "uint64", + "name": "start" + }, + { + "type": "uint32", + "name": "duration" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getAvailableRewards", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "address", + "name": "distributor" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getRewardRate", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "address", + "name": "distributor" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "registerRewardsDistributor", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "address", + "name": "distributor" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "removeRewardsDistributor", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "address", + "name": "distributor" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "updateRewards", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "uint256[]", + "name": "" + }, + { + "type": "address[]", + "name": "" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "NewSupportedCrossChainNetwork", + "inputs": [ + { + "type": "uint64", + "name": "newChainId", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "configureChainlinkCrossChain", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "ccipRouter" + }, + { + "type": "address", + "name": "ccipTokenPool" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "configureOracleManager", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "oracleManagerAddress" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getConfig", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "k" + } + ], + "outputs": [ + { + "type": "bytes32", + "name": "v" + } + ] + }, + { + "type": "function", + "name": "getConfigAddress", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "k" + } + ], + "outputs": [ + { + "type": "address", + "name": "v" + } + ] + }, + { + "type": "function", + "name": "getConfigUint", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "k" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "v" + } + ] + }, + { + "type": "function", + "name": "getTrustedForwarder", + "constant": true, + "stateMutability": "pure", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isTrustedForwarder", + "constant": true, + "stateMutability": "pure", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "forwarder" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "setConfig", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "k" + }, + { + "type": "bytes32", + "name": "v" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setSupportedCrossChainNetworks", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint64[]", + "name": "supportedNetworks" + }, + { + "type": "uint64[]", + "name": "ccipSelectors" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "numRegistered" + } + ] + }, + { + "type": "function", + "name": "supportsInterface", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes4", + "name": "interfaceId" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "error", + "name": "InsufficientDelegation", + "inputs": [ + { + "type": "uint256", + "name": "minDelegation" + } + ] + }, + { + "type": "error", + "name": "InvalidCollateralAmount", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidLeverage", + "inputs": [ + { + "type": "uint256", + "name": "leverage" + } + ] + }, + { + "type": "error", + "name": "PoolCollateralLimitExceeded", + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "currentCollateral" + }, + { + "type": "uint256", + "name": "maxCollateral" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "DelegationUpdated", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint128", + "name": "poolId", + "indexed": true + }, + { + "type": "address", + "name": "collateralType", + "indexed": false + }, + { + "type": "uint256", + "name": "amount", + "indexed": false + }, + { + "type": "uint256", + "name": "leverage", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "function", + "name": "delegateCollateral", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "newCollateralAmountD18" + }, + { + "type": "uint256", + "name": "leverage" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getPosition", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "collateralAmount" + }, + { + "type": "uint256", + "name": "collateralValue" + }, + { + "type": "int256", + "name": "debt" + }, + { + "type": "uint256", + "name": "collateralizationRatio" + } + ] + }, + { + "type": "function", + "name": "getPositionCollateral", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "amount" + } + ] + }, + { + "type": "function", + "name": "getPositionCollateralRatio", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getPositionDebt", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "int256", + "name": "debt" + } + ] + }, + { + "type": "function", + "name": "getVaultCollateral", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "amount" + }, + { + "type": "uint256", + "name": "value" + } + ] + }, + { + "type": "function", + "name": "getVaultCollateralRatio", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getVaultDebt", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "poolId" + }, + { + "type": "address", + "name": "collateralType" + } + ], + "outputs": [ + { + "type": "int256", + "name": "" + } + ] + } +] diff --git a/indexers/arbitrum-sepolia/src/abi/CoreProxy.ts b/indexers/arbitrum-sepolia/src/abi/CoreProxy.ts new file mode 100644 index 00000000..a471d019 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/abi/CoreProxy.ts @@ -0,0 +1,783 @@ +import * as ethers from 'ethers' +import {LogEvent, Func, ContractBase} from './abi.support' +import {ABI_JSON} from './CoreProxy.abi' + +export const abi = new ethers.Interface(ABI_JSON); + +export const events = { + OwnerChanged: new LogEvent<([oldOwner: string, newOwner: string] & {oldOwner: string, newOwner: string})>( + abi, '0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c' + ), + OwnerNominated: new LogEvent<([newOwner: string] & {newOwner: string})>( + abi, '0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22' + ), + Upgraded: new LogEvent<([self: string, implementation: string] & {self: string, implementation: string})>( + abi, '0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7' + ), + FeatureFlagAllowAllSet: new LogEvent<([feature: string, allowAll: boolean] & {feature: string, allowAll: boolean})>( + abi, '0xa806035d8c8de7cd43725250d3fbf9ee7abe3b99ffb892897913d8a21721121d' + ), + FeatureFlagAllowlistAdded: new LogEvent<([feature: string, account: string] & {feature: string, account: string})>( + abi, '0x30b9b4104e2fb00b4f980e414dcd828e691c8fcb286f0c73d7267c3a2de49383' + ), + FeatureFlagAllowlistRemoved: new LogEvent<([feature: string, account: string] & {feature: string, account: string})>( + abi, '0xb44a47e11880cc865e8ea382561e406dea8c895366c58e3908f05708b2880890' + ), + FeatureFlagDeniersReset: new LogEvent<([feature: string, deniers: Array] & {feature: string, deniers: Array})>( + abi, '0x74d48d0b51a70680130c00decd06b4d536fbb3cee16a3b0bdd2309c264dcbd13' + ), + FeatureFlagDenyAllSet: new LogEvent<([feature: string, denyAll: boolean] & {feature: string, denyAll: boolean})>( + abi, '0x97f76d2e384948e28ddd4280a4e76e8600acc328a0c0910c93682a0fccc02018' + ), + AccountCreated: new LogEvent<([accountId: bigint, owner: string] & {accountId: bigint, owner: string})>( + abi, '0xa9e04d307e860938fa63307df8b8090e365276e59fcca12ed55656c25e538019' + ), + PermissionGranted: new LogEvent<([accountId: bigint, permission: string, user: string, sender: string] & {accountId: bigint, permission: string, user: string, sender: string})>( + abi, '0x32ff7c3f84299a3543c1e89057e98ba962f4fbe7786c52289e184c57b9a36a50' + ), + PermissionRevoked: new LogEvent<([accountId: bigint, permission: string, user: string, sender: string] & {accountId: bigint, permission: string, user: string, sender: string})>( + abi, '0x116c7e9cd2db316974fb473babcbcd625be1350842d0319e761d30aefb09a58a' + ), + DebtAssociated: new LogEvent<([marketId: bigint, poolId: bigint, collateralType: string, accountId: bigint, amount: bigint, updatedDebt: bigint] & {marketId: bigint, poolId: bigint, collateralType: string, accountId: bigint, amount: bigint, updatedDebt: bigint})>( + abi, '0xb03bc7530b5650601d2c8bc86c81a45b6b50b0099defd3f17a6bdb48660180ad' + ), + AssociatedSystemSet: new LogEvent<([kind: string, id: string, proxy: string, impl: string] & {kind: string, id: string, proxy: string, impl: string})>( + abi, '0xc8551a5a03a7b06d5d20159b3b8839429a7aefab4bf3d020f1b65fa903ccb3d2' + ), + CollateralLockCreated: new LogEvent<([accountId: bigint, collateralType: string, tokenAmount: bigint, expireTimestamp: bigint] & {accountId: bigint, collateralType: string, tokenAmount: bigint, expireTimestamp: bigint})>( + abi, '0x8a78446a234220d3ee3f46aa6ea1ea5bc438bd153398ebcbd171843744b452a6' + ), + CollateralLockExpired: new LogEvent<([accountId: bigint, collateralType: string, tokenAmount: bigint, expireTimestamp: bigint] & {accountId: bigint, collateralType: string, tokenAmount: bigint, expireTimestamp: bigint})>( + abi, '0xc5e2c7afc4e54d998977e11260a0bfc0ad5678a3a8b6628162f9d4e642d7f160' + ), + Deposited: new LogEvent<([accountId: bigint, collateralType: string, tokenAmount: bigint, sender: string] & {accountId: bigint, collateralType: string, tokenAmount: bigint, sender: string})>( + abi, '0xd92122e67326e9313bfae33ccb1fccf5194584c6bf93a8529a6b006d8c6e24a9' + ), + Withdrawn: new LogEvent<([accountId: bigint, collateralType: string, tokenAmount: bigint, sender: string] & {accountId: bigint, collateralType: string, tokenAmount: bigint, sender: string})>( + abi, '0x8b5f9d7ce522936589c630db08c0fa2405b21c4a5ff8ef19899900172736ba38' + ), + CollateralConfigured: new LogEvent<([collateralType: string, config: ([depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint] & {depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint})] & {collateralType: string, config: ([depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint] & {depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint})})>( + abi, '0xefc23317f58afd6b22480bd22174cc7da0913bce25c03d9859216dacddebe6fe' + ), + TransferCrossChainInitiated: new LogEvent<([destChainId: bigint, amount: bigint, sender: string] & {destChainId: bigint, amount: bigint, sender: string})>( + abi, '0xb87c3097d7f9145a4915e8e434f04a1b7b91646d8a6e66a5cdab25caccb644c4' + ), + IssuanceFeePaid: new LogEvent<([accountId: bigint, poolId: bigint, collateralType: string, feeAmount: bigint] & {accountId: bigint, poolId: bigint, collateralType: string, feeAmount: bigint})>( + abi, '0x28d0fb10e1c8ce51490a16fb3b40bf23f8064f7c624d3a3852ad66683a25995d' + ), + UsdBurned: new LogEvent<([accountId: bigint, poolId: bigint, collateralType: string, amount: bigint, sender: string] & {accountId: bigint, poolId: bigint, collateralType: string, amount: bigint, sender: string})>( + abi, '0x6b0230f0abe9188cbdbb1c816a4c5e213758b5b743d8a94af056280cc1e7aeb1' + ), + UsdMinted: new LogEvent<([accountId: bigint, poolId: bigint, collateralType: string, amount: bigint, sender: string] & {accountId: bigint, poolId: bigint, collateralType: string, amount: bigint, sender: string})>( + abi, '0x2100f67dc9a5917400f799bb13194553e3f74c19a207c56350d2c223ac9c36c9' + ), + Liquidation: new LogEvent<([accountId: bigint, poolId: bigint, collateralType: string, liquidationData: ([debtLiquidated: bigint, collateralLiquidated: bigint, amountRewarded: bigint] & {debtLiquidated: bigint, collateralLiquidated: bigint, amountRewarded: bigint}), liquidateAsAccountId: bigint, sender: string] & {accountId: bigint, poolId: bigint, collateralType: string, liquidationData: ([debtLiquidated: bigint, collateralLiquidated: bigint, amountRewarded: bigint] & {debtLiquidated: bigint, collateralLiquidated: bigint, amountRewarded: bigint}), liquidateAsAccountId: bigint, sender: string})>( + abi, '0xe6c1b26644f880854bf954d4186be9f0b2d06d50fa0484b596e79d409c07a5fd' + ), + VaultLiquidation: new LogEvent<([poolId: bigint, collateralType: string, liquidationData: ([debtLiquidated: bigint, collateralLiquidated: bigint, amountRewarded: bigint] & {debtLiquidated: bigint, collateralLiquidated: bigint, amountRewarded: bigint}), liquidateAsAccountId: bigint, sender: string] & {poolId: bigint, collateralType: string, liquidationData: ([debtLiquidated: bigint, collateralLiquidated: bigint, amountRewarded: bigint] & {debtLiquidated: bigint, collateralLiquidated: bigint, amountRewarded: bigint}), liquidateAsAccountId: bigint, sender: string})>( + abi, '0x1834a7cc9d14f9bfa482df5c0404dadd1b8ec123b41f082e76ae28a3b2ea68d5' + ), + MarketCollateralDeposited: new LogEvent<([marketId: bigint, collateralType: string, tokenAmount: bigint, sender: string, creditCapacity: bigint, netIssuance: bigint, depositedCollateralValue: bigint, reportedDebt: bigint] & {marketId: bigint, collateralType: string, tokenAmount: bigint, sender: string, creditCapacity: bigint, netIssuance: bigint, depositedCollateralValue: bigint, reportedDebt: bigint})>( + abi, '0x0268c0025d1310f8cbf9a431c755af708633271b9b5902855857297267d6f41b' + ), + MarketCollateralWithdrawn: new LogEvent<([marketId: bigint, collateralType: string, tokenAmount: bigint, sender: string, creditCapacity: bigint, netIssuance: bigint, depositedCollateralValue: bigint, reportedDebt: bigint] & {marketId: bigint, collateralType: string, tokenAmount: bigint, sender: string, creditCapacity: bigint, netIssuance: bigint, depositedCollateralValue: bigint, reportedDebt: bigint})>( + abi, '0x88eb4cc1feb3af3a3e45798dc1d42ec34ef453093ffe0c56fc36e27abd2cc4d7' + ), + MaximumMarketCollateralConfigured: new LogEvent<([marketId: bigint, collateralType: string, systemAmount: bigint, owner: string] & {marketId: bigint, collateralType: string, systemAmount: bigint, owner: string})>( + abi, '0x499c8fcfbc4341c37dcf444c890d42ef888d46aa586f97ceb20577c2635c8075' + ), + MarketRegistered: new LogEvent<([market: string, marketId: bigint, sender: string] & {market: string, marketId: bigint, sender: string})>( + abi, '0xeb87361ace8c1947e121293eb214f68d889d9cf273c48246b38c3cbf185748d0' + ), + MarketSystemFeePaid: new LogEvent<([marketId: bigint, feeAmount: bigint] & {marketId: bigint, feeAmount: bigint})>( + abi, '0x8b69fed8aed97ef9572216662359ece45fa52f2b5ff44a78b7ec3c5ef05153f8' + ), + MarketUsdDeposited: new LogEvent<([marketId: bigint, target: string, amount: bigint, market: string, creditCapacity: bigint, netIssuance: bigint, depositedCollateralValue: bigint] & {marketId: bigint, target: string, amount: bigint, market: string, creditCapacity: bigint, netIssuance: bigint, depositedCollateralValue: bigint})>( + abi, '0x9a027325990fdf972bdf1b29c875c0b38eb13c24b40eb1c3e76c59fbccae7c24' + ), + MarketUsdWithdrawn: new LogEvent<([marketId: bigint, target: string, amount: bigint, market: string, creditCapacity: bigint, netIssuance: bigint, depositedCollateralValue: bigint] & {marketId: bigint, target: string, amount: bigint, market: string, creditCapacity: bigint, netIssuance: bigint, depositedCollateralValue: bigint})>( + abi, '0x78275f67a7ec18521036f43b5352fa06fb6b886629ae2c532dd1093504bc6acc' + ), + SetMarketMinLiquidityRatio: new LogEvent<([marketId: bigint, minLiquidityRatio: bigint] & {marketId: bigint, minLiquidityRatio: bigint})>( + abi, '0x563eb723f21b3e87ec8932cfb4ffa64d1b68c42053c28d6b4db019a40f6daf47' + ), + SetMinDelegateTime: new LogEvent<([marketId: bigint, minDelegateTime: number] & {marketId: bigint, minDelegateTime: number})>( + abi, '0x6942a68d151863c1fed3c0c4c5f3258af738218527147ac69290ab23ca7d26c6' + ), + PoolApprovedAdded: new LogEvent<([poolId: bigint] & {poolId: bigint})>( + abi, '0x7d5bdf4e8c44e0b5a8249bf03c2a1febd848cc7f580efd7b1703301c5b1a9e4e' + ), + PoolApprovedRemoved: new LogEvent<([poolId: bigint] & {poolId: bigint})>( + abi, '0xc1567ee9983f306f073ea7d59a7fb5680ce07985f8b49cc50d00a3a9f748d3c2' + ), + PreferredPoolSet: new LogEvent<([poolId: bigint] & {poolId: bigint})>( + abi, '0x7e7cb4726e710dc12fad41f158c37a4a71af3a6f053b8b13670d35c710139a56' + ), + PoolCollateralConfigurationUpdated: new LogEvent<([poolId: bigint, collateralType: string, config: ([collateralLimitD18: bigint, issuanceRatioD18: bigint] & {collateralLimitD18: bigint, issuanceRatioD18: bigint})] & {poolId: bigint, collateralType: string, config: ([collateralLimitD18: bigint, issuanceRatioD18: bigint] & {collateralLimitD18: bigint, issuanceRatioD18: bigint})})>( + abi, '0x5ebb5c59166ab9735b293a159ee2129e61d16b526867763f25557a275a2aad92' + ), + PoolCollateralDisabledByDefaultSet: new LogEvent<([poolId: bigint, disabled: boolean] & {poolId: bigint, disabled: boolean})>( + abi, '0xe0ed98ef42e6a4a881ae0d3c4459c9ed06a36a2144e02efc11823c6cae515bf2' + ), + PoolConfigurationSet: new LogEvent<([poolId: bigint, markets: Array<([marketId: bigint, weightD18: bigint, maxDebtShareValueD18: bigint] & {marketId: bigint, weightD18: bigint, maxDebtShareValueD18: bigint})>, sender: string] & {poolId: bigint, markets: Array<([marketId: bigint, weightD18: bigint, maxDebtShareValueD18: bigint] & {marketId: bigint, weightD18: bigint, maxDebtShareValueD18: bigint})>, sender: string})>( + abi, '0xdd812c2e47943d98e6c66b2b9872d1f9270b8523c82eb60ad5c8d580a614081c' + ), + PoolCreated: new LogEvent<([poolId: bigint, owner: string, sender: string] & {poolId: bigint, owner: string, sender: string})>( + abi, '0xb1517ad708e5f9a104c30d3f1ff749d55833b1d03bf472013c29888e741cf340' + ), + PoolNameUpdated: new LogEvent<([poolId: bigint, name: string, sender: string] & {poolId: bigint, name: string, sender: string})>( + abi, '0x63b42abaf7e145a993f20bc64259f45d09c43d18838ab0bca078b15093ac55f4' + ), + PoolNominationRenounced: new LogEvent<([poolId: bigint, owner: string] & {poolId: bigint, owner: string})>( + abi, '0x28301da5fb0feefb138efa6310af4547a74f415d62616f90519436dc169c3ae0' + ), + PoolNominationRevoked: new LogEvent<([poolId: bigint, owner: string] & {poolId: bigint, owner: string})>( + abi, '0xa20a605599b6da4a06e0662f1284c442a576bc452b77a38c8c55805cb82a1865' + ), + PoolOwnerNominated: new LogEvent<([poolId: bigint, nominatedOwner: string, owner: string] & {poolId: bigint, nominatedOwner: string, owner: string})>( + abi, '0x55d98f82a53fb5776e9ea48d624ab9cb015b51a45249b1ed8425fc857c82f4f8' + ), + PoolOwnershipAccepted: new LogEvent<([poolId: bigint, owner: string] & {poolId: bigint, owner: string})>( + abi, '0x4f86f2ce8b08e27d0e470f4269b71c3bbc68407d51a2e692f6573236074ebc5a' + ), + PoolOwnershipRenounced: new LogEvent<([poolId: bigint, owner: string] & {poolId: bigint, owner: string})>( + abi, '0x0d1df5c898ce9334fe91f342f5c07b0eea630d388f90b4e07e85753d61252734' + ), + SetMinLiquidityRatio: new LogEvent<([minLiquidityRatio: bigint] & {minLiquidityRatio: bigint})>( + abi, '0x66fd484d9868d1faddc8fef1f3faed0ed25eb4e6acde49dd1f2cbf0fba903635' + ), + RewardsClaimed: new LogEvent<([accountId: bigint, poolId: bigint, collateralType: string, distributor: string, amount: bigint] & {accountId: bigint, poolId: bigint, collateralType: string, distributor: string, amount: bigint})>( + abi, '0xa4a60be4203e7975e54ab5314c7e9e18aba9ad71e8da714d8de987f4f05410f2' + ), + RewardsDistributed: new LogEvent<([poolId: bigint, collateralType: string, distributor: string, amount: bigint, start: bigint, duration: bigint] & {poolId: bigint, collateralType: string, distributor: string, amount: bigint, start: bigint, duration: bigint})>( + abi, '0x19ced31d71d1db45f99d5a8d3a7616fe9d78828df58f2a28feb68c9f9ab876ca' + ), + RewardsDistributorRegistered: new LogEvent<([poolId: bigint, collateralType: string, distributor: string] & {poolId: bigint, collateralType: string, distributor: string})>( + abi, '0x9d3609c05a83dc93a5b355d62c2b37dfde8f0833b1184d4d05c6f51cd46b6e5b' + ), + RewardsDistributorRemoved: new LogEvent<([poolId: bigint, collateralType: string, distributor: string] & {poolId: bigint, collateralType: string, distributor: string})>( + abi, '0x375c4507f463c55a506be95e2cfd3cfdc0610be055087eac6049588a1bcfacba' + ), + NewSupportedCrossChainNetwork: new LogEvent<([newChainId: bigint] & {newChainId: bigint})>( + abi, '0x1874eb2a5288e478dcedf1d33291bd7293eeef5946ec516d2ef54a364b3f63d8' + ), + DelegationUpdated: new LogEvent<([accountId: bigint, poolId: bigint, collateralType: string, amount: bigint, leverage: bigint, sender: string] & {accountId: bigint, poolId: bigint, collateralType: string, amount: bigint, leverage: bigint, sender: string})>( + abi, '0x7b12dd38f18c0ff77ae702f6da13fbbcb28f53f807ecc7d39ee8d8b1ea8295ad' + ), +} + +export const functions = { + acceptOwnership: new Func<[], {}, []>( + abi, '0x79ba5097' + ), + getImplementation: new Func<[], {}, string>( + abi, '0xaaf10f42' + ), + nominateNewOwner: new Func<[newNominatedOwner: string], {newNominatedOwner: string}, []>( + abi, '0x1627540c' + ), + nominatedOwner: new Func<[], {}, string>( + abi, '0x53a47bb7' + ), + owner: new Func<[], {}, string>( + abi, '0x8da5cb5b' + ), + renounceNomination: new Func<[], {}, []>( + abi, '0x718fe928' + ), + simulateUpgradeTo: new Func<[newImplementation: string], {newImplementation: string}, []>( + abi, '0xc7f62cda' + ), + upgradeTo: new Func<[newImplementation: string], {newImplementation: string}, []>( + abi, '0x3659cfe6' + ), + addToFeatureFlagAllowlist: new Func<[feature: string, account: string], {feature: string, account: string}, []>( + abi, '0xa0778144' + ), + getDeniers: new Func<[feature: string], {feature: string}, Array>( + abi, '0xed429cf7' + ), + getFeatureFlagAllowAll: new Func<[feature: string], {feature: string}, boolean>( + abi, '0x40a399ef' + ), + getFeatureFlagAllowlist: new Func<[feature: string], {feature: string}, Array>( + abi, '0xe12c8160' + ), + getFeatureFlagDenyAll: new Func<[feature: string], {feature: string}, boolean>( + abi, '0xbcae3ea0' + ), + isFeatureAllowed: new Func<[feature: string, account: string], {feature: string, account: string}, boolean>( + abi, '0xcf635949' + ), + removeFromFeatureFlagAllowlist: new Func<[feature: string, account: string], {feature: string, account: string}, []>( + abi, '0xb7746b59' + ), + setDeniers: new Func<[feature: string, deniers: Array], {feature: string, deniers: Array}, []>( + abi, '0x715cb7d2' + ), + setFeatureFlagAllowAll: new Func<[feature: string, allowAll: boolean], {feature: string, allowAll: boolean}, []>( + abi, '0x7d632bd2' + ), + setFeatureFlagDenyAll: new Func<[feature: string, denyAll: boolean], {feature: string, denyAll: boolean}, []>( + abi, '0x5e52ad6e' + ), + 'createAccount()': new Func<[], {}, bigint>( + abi, '0x9dca362f' + ), + 'createAccount(uint128)': new Func<[requestedAccountId: bigint], {requestedAccountId: bigint}, []>( + abi, '0xcadb09a5' + ), + getAccountLastInteraction: new Func<[accountId: bigint], {accountId: bigint}, bigint>( + abi, '0x1b5dccdb' + ), + getAccountOwner: new Func<[accountId: bigint], {accountId: bigint}, string>( + abi, '0xbf60c31d' + ), + getAccountPermissions: new Func<[accountId: bigint], {accountId: bigint}, Array<([user: string, permissions: Array] & {user: string, permissions: Array})>>( + abi, '0xa796fecd' + ), + getAccountTokenAddress: new Func<[], {}, string>( + abi, '0xa148bf10' + ), + grantPermission: new Func<[accountId: bigint, permission: string, user: string], {accountId: bigint, permission: string, user: string}, []>( + abi, '0x00cd9ef3' + ), + hasPermission: new Func<[accountId: bigint, permission: string, user: string], {accountId: bigint, permission: string, user: string}, boolean>( + abi, '0x8d34166b' + ), + isAuthorized: new Func<[accountId: bigint, permission: string, user: string], {accountId: bigint, permission: string, user: string}, boolean>( + abi, '0x1213d453' + ), + notifyAccountTransfer: new Func<[to: string, accountId: bigint], {to: string, accountId: bigint}, []>( + abi, '0x7dec8b55' + ), + renouncePermission: new Func<[accountId: bigint, permission: string], {accountId: bigint, permission: string}, []>( + abi, '0x47c1c561' + ), + revokePermission: new Func<[accountId: bigint, permission: string, user: string], {accountId: bigint, permission: string, user: string}, []>( + abi, '0xa7627288' + ), + associateDebt: new Func<[marketId: bigint, poolId: bigint, collateralType: string, accountId: bigint, amount: bigint], {marketId: bigint, poolId: bigint, collateralType: string, accountId: bigint, amount: bigint}, bigint>( + abi, '0x11aa282d' + ), + getAssociatedSystem: new Func<[id: string], {id: string}, ([addr: string, kind: string] & {addr: string, kind: string})>( + abi, '0x60988e09' + ), + initOrUpgradeNft: new Func<[id: string, name: string, symbol: string, uri: string, impl: string], {id: string, name: string, symbol: string, uri: string, impl: string}, []>( + abi, '0x2d22bef9' + ), + initOrUpgradeToken: new Func<[id: string, name: string, symbol: string, decimals: number, impl: string], {id: string, name: string, symbol: string, decimals: number, impl: string}, []>( + abi, '0xc6f79537' + ), + registerUnmanagedSystem: new Func<[id: string, endpoint: string], {id: string, endpoint: string}, []>( + abi, '0xd245d983' + ), + ccipReceive: new Func<[message: ([messageId: string, sourceChainSelector: bigint, sender: string, data: string, tokenAmounts: Array<([token: string, amount: bigint] & {token: string, amount: bigint})>] & {messageId: string, sourceChainSelector: bigint, sender: string, data: string, tokenAmounts: Array<([token: string, amount: bigint] & {token: string, amount: bigint})>})], {message: ([messageId: string, sourceChainSelector: bigint, sender: string, data: string, tokenAmounts: Array<([token: string, amount: bigint] & {token: string, amount: bigint})>] & {messageId: string, sourceChainSelector: bigint, sender: string, data: string, tokenAmounts: Array<([token: string, amount: bigint] & {token: string, amount: bigint})>})}, []>( + abi, '0x85572ffb' + ), + cleanExpiredLocks: new Func<[accountId: bigint, collateralType: string, offset: bigint, count: bigint], {accountId: bigint, collateralType: string, offset: bigint, count: bigint}, bigint>( + abi, '0x198f0aa1' + ), + createLock: new Func<[accountId: bigint, collateralType: string, amount: bigint, expireTimestamp: bigint], {accountId: bigint, collateralType: string, amount: bigint, expireTimestamp: bigint}, []>( + abi, '0x0bae9893' + ), + deposit: new Func<[accountId: bigint, collateralType: string, tokenAmount: bigint], {accountId: bigint, collateralType: string, tokenAmount: bigint}, []>( + abi, '0x83802968' + ), + getAccountAvailableCollateral: new Func<[accountId: bigint, collateralType: string], {accountId: bigint, collateralType: string}, bigint>( + abi, '0x927482ff' + ), + getAccountCollateral: new Func<[accountId: bigint, collateralType: string], {accountId: bigint, collateralType: string}, ([totalDeposited: bigint, totalAssigned: bigint, totalLocked: bigint] & {totalDeposited: bigint, totalAssigned: bigint, totalLocked: bigint})>( + abi, '0xef45148e' + ), + getLocks: new Func<[accountId: bigint, collateralType: string, offset: bigint, count: bigint], {accountId: bigint, collateralType: string, offset: bigint, count: bigint}, Array<([amountD18: bigint, lockExpirationTime: bigint] & {amountD18: bigint, lockExpirationTime: bigint})>>( + abi, '0xaa8c6369' + ), + withdraw: new Func<[accountId: bigint, collateralType: string, tokenAmount: bigint], {accountId: bigint, collateralType: string, tokenAmount: bigint}, []>( + abi, '0x95997c51' + ), + configureCollateral: new Func<[config: ([depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint] & {depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint})], {config: ([depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint] & {depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint})}, []>( + abi, '0x644cb0f3' + ), + getCollateralConfiguration: new Func<[collateralType: string], {collateralType: string}, ([depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint] & {depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint})>( + abi, '0xdc0b3f52' + ), + getCollateralConfigurations: new Func<[hideDisabled: boolean], {hideDisabled: boolean}, Array<([depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint] & {depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint})>>( + abi, '0x75bf2444' + ), + getCollateralPrice: new Func<[collateralType: string], {collateralType: string}, bigint>( + abi, '0x51a40994' + ), + transferCrossChain: new Func<[destChainId: bigint, amount: bigint], {destChainId: bigint, amount: bigint}, bigint>( + abi, '0x340824d7' + ), + burnUsd: new Func<[accountId: bigint, poolId: bigint, collateralType: string, amount: bigint], {accountId: bigint, poolId: bigint, collateralType: string, amount: bigint}, []>( + abi, '0xd3264e43' + ), + mintUsd: new Func<[accountId: bigint, poolId: bigint, collateralType: string, amount: bigint], {accountId: bigint, poolId: bigint, collateralType: string, amount: bigint}, []>( + abi, '0xdf16a074' + ), + isPositionLiquidatable: new Func<[accountId: bigint, poolId: bigint, collateralType: string], {accountId: bigint, poolId: bigint, collateralType: string}, boolean>( + abi, '0x2fa7bb65' + ), + isVaultLiquidatable: new Func<[poolId: bigint, collateralType: string], {poolId: bigint, collateralType: string}, boolean>( + abi, '0x2a5354d2' + ), + liquidate: new Func<[accountId: bigint, poolId: bigint, collateralType: string, liquidateAsAccountId: bigint], {accountId: bigint, poolId: bigint, collateralType: string, liquidateAsAccountId: bigint}, ([debtLiquidated: bigint, collateralLiquidated: bigint, amountRewarded: bigint] & {debtLiquidated: bigint, collateralLiquidated: bigint, amountRewarded: bigint})>( + abi, '0x3e033a06' + ), + liquidateVault: new Func<[poolId: bigint, collateralType: string, liquidateAsAccountId: bigint, maxUsd: bigint], {poolId: bigint, collateralType: string, liquidateAsAccountId: bigint, maxUsd: bigint}, ([debtLiquidated: bigint, collateralLiquidated: bigint, amountRewarded: bigint] & {debtLiquidated: bigint, collateralLiquidated: bigint, amountRewarded: bigint})>( + abi, '0x7d8a4140' + ), + configureMaximumMarketCollateral: new Func<[marketId: bigint, collateralType: string, amount: bigint], {marketId: bigint, collateralType: string, amount: bigint}, []>( + abi, '0xdbdea94c' + ), + depositMarketCollateral: new Func<[marketId: bigint, collateralType: string, tokenAmount: bigint], {marketId: bigint, collateralType: string, tokenAmount: bigint}, []>( + abi, '0xa4e6306b' + ), + getMarketCollateralAmount: new Func<[marketId: bigint, collateralType: string], {marketId: bigint, collateralType: string}, bigint>( + abi, '0xc2b0cf41' + ), + getMarketCollateralValue: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0xd4f88381' + ), + getMaximumMarketCollateral: new Func<[marketId: bigint, collateralType: string], {marketId: bigint, collateralType: string}, bigint>( + abi, '0x12e1c673' + ), + withdrawMarketCollateral: new Func<[marketId: bigint, collateralType: string, tokenAmount: bigint], {marketId: bigint, collateralType: string, tokenAmount: bigint}, []>( + abi, '0xa3aa8b51' + ), + depositMarketUsd: new Func<[marketId: bigint, target: string, amount: bigint], {marketId: bigint, target: string, amount: bigint}, bigint>( + abi, '0x10b0cf76' + ), + distributeDebtToPools: new Func<[marketId: bigint, maxIter: bigint], {marketId: bigint, maxIter: bigint}, boolean>( + abi, '0xa0c12269' + ), + getMarketAddress: new Func<[marketId: bigint], {marketId: bigint}, string>( + abi, '0xd24437f1' + ), + getMarketCollateral: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x150834a3' + ), + getMarketDebtPerShare: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x95909ba3' + ), + getMarketFees: new Func<[_: bigint, amount: bigint], {amount: bigint}, ([depositFeeAmount: bigint, withdrawFeeAmount: bigint] & {depositFeeAmount: bigint, withdrawFeeAmount: bigint})>( + abi, '0xdfb83437' + ), + getMarketMinDelegateTime: new Func<[marketId: bigint], {marketId: bigint}, number>( + abi, '0x5424901b' + ), + getMarketNetIssuance: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x85d99ebc' + ), + getMarketPoolDebtDistribution: new Func<[marketId: bigint, poolId: bigint], {marketId: bigint, poolId: bigint}, ([sharesD18: bigint, totalSharesD18: bigint, valuePerShareD27: bigint] & {sharesD18: bigint, totalSharesD18: bigint, valuePerShareD27: bigint})>( + abi, '0x25eeea4b' + ), + getMarketPools: new Func<[marketId: bigint], {marketId: bigint}, ([inRangePoolIds: Array, outRangePoolIds: Array] & {inRangePoolIds: Array, outRangePoolIds: Array})>( + abi, '0xbe0b8e6f' + ), + getMarketReportedDebt: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x86e3b1cf' + ), + getMarketTotalDebt: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0xbaa2a264' + ), + 'getMinLiquidityRatio(uint128)': new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x84f29b6d' + ), + getOracleManager: new Func<[], {}, string>( + abi, '0xb01ceccd' + ), + getUsdToken: new Func<[], {}, string>( + abi, '0x21f1d9e5' + ), + getWithdrawableMarketUsd: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x1eb60770' + ), + isMarketCapacityLocked: new Func<[marketId: bigint], {marketId: bigint}, boolean>( + abi, '0x07003f0a' + ), + registerMarket: new Func<[market: string], {market: string}, bigint>( + abi, '0xa79b9ec9' + ), + setMarketMinDelegateTime: new Func<[marketId: bigint, minDelegateTime: number], {marketId: bigint, minDelegateTime: number}, []>( + abi, '0x1d90e392' + ), + 'setMinLiquidityRatio(uint128,uint256)': new Func<[marketId: bigint, minLiquidityRatio: bigint], {marketId: bigint, minLiquidityRatio: bigint}, []>( + abi, '0x6fd5bdce' + ), + withdrawMarketUsd: new Func<[marketId: bigint, target: string, amount: bigint], {marketId: bigint, target: string, amount: bigint}, bigint>( + abi, '0x140a7cfe' + ), + addApprovedPool: new Func<[poolId: bigint], {poolId: bigint}, []>( + abi, '0xb790a1ae' + ), + getApprovedPools: new Func<[], {}, Array>( + abi, '0x48741626' + ), + getPreferredPool: new Func<[], {}, bigint>( + abi, '0x3b390b57' + ), + removeApprovedPool: new Func<[poolId: bigint], {poolId: bigint}, []>( + abi, '0xe1b440d0' + ), + setPreferredPool: new Func<[poolId: bigint], {poolId: bigint}, []>( + abi, '0xe7098c0c' + ), + acceptPoolOwnership: new Func<[poolId: bigint], {poolId: bigint}, []>( + abi, '0xc707a39f' + ), + createPool: new Func<[requestedPoolId: bigint, owner: string], {requestedPoolId: bigint, owner: string}, []>( + abi, '0xcaab529b' + ), + 'getMinLiquidityRatio()': new Func<[], {}, bigint>( + abi, '0xfd85c1f8' + ), + getNominatedPoolOwner: new Func<[poolId: bigint], {poolId: bigint}, string>( + abi, '0x9851af01' + ), + getPoolCollateralConfiguration: new Func<[poolId: bigint, collateralType: string], {poolId: bigint, collateralType: string}, ([collateralLimitD18: bigint, issuanceRatioD18: bigint] & {collateralLimitD18: bigint, issuanceRatioD18: bigint})>( + abi, '0xc77e51f6' + ), + getPoolCollateralIssuanceRatio: new Func<[poolId: bigint, collateral: string], {poolId: bigint, collateral: string}, bigint>( + abi, '0xc4d2aad3' + ), + getPoolConfiguration: new Func<[poolId: bigint], {poolId: bigint}, Array<([marketId: bigint, weightD18: bigint, maxDebtShareValueD18: bigint] & {marketId: bigint, weightD18: bigint, maxDebtShareValueD18: bigint})>>( + abi, '0xefecf137' + ), + getPoolName: new Func<[poolId: bigint], {poolId: bigint}, string>( + abi, '0xf86e6f91' + ), + getPoolOwner: new Func<[poolId: bigint], {poolId: bigint}, string>( + abi, '0xbbdd7c5a' + ), + nominatePoolOwner: new Func<[nominatedOwner: string, poolId: bigint], {nominatedOwner: string, poolId: bigint}, []>( + abi, '0x6141f7a2' + ), + rebalancePool: new Func<[poolId: bigint, optionalCollateralType: string], {poolId: bigint, optionalCollateralType: string}, []>( + abi, '0x183231d7' + ), + renouncePoolNomination: new Func<[poolId: bigint], {poolId: bigint}, []>( + abi, '0xca5bed77' + ), + renouncePoolOwnership: new Func<[poolId: bigint], {poolId: bigint}, []>( + abi, '0x7cc14a92' + ), + revokePoolNomination: new Func<[poolId: bigint], {poolId: bigint}, []>( + abi, '0x1f1b33b9' + ), + 'setMinLiquidityRatio(uint256)': new Func<[minLiquidityRatio: bigint], {minLiquidityRatio: bigint}, []>( + abi, '0x34078a01' + ), + setPoolCollateralConfiguration: new Func<[poolId: bigint, collateralType: string, newConfig: ([collateralLimitD18: bigint, issuanceRatioD18: bigint] & {collateralLimitD18: bigint, issuanceRatioD18: bigint})], {poolId: bigint, collateralType: string, newConfig: ([collateralLimitD18: bigint, issuanceRatioD18: bigint] & {collateralLimitD18: bigint, issuanceRatioD18: bigint})}, []>( + abi, '0x5a4aabb1' + ), + setPoolCollateralDisabledByDefault: new Func<[poolId: bigint, disabled: boolean], {poolId: bigint, disabled: boolean}, []>( + abi, '0x4c6568b1' + ), + setPoolConfiguration: new Func<[poolId: bigint, newMarketConfigurations: Array<([marketId: bigint, weightD18: bigint, maxDebtShareValueD18: bigint] & {marketId: bigint, weightD18: bigint, maxDebtShareValueD18: bigint})>], {poolId: bigint, newMarketConfigurations: Array<([marketId: bigint, weightD18: bigint, maxDebtShareValueD18: bigint] & {marketId: bigint, weightD18: bigint, maxDebtShareValueD18: bigint})>}, []>( + abi, '0x5d8c8844' + ), + setPoolName: new Func<[poolId: bigint, name: string], {poolId: bigint, name: string}, []>( + abi, '0x11e72a43' + ), + claimRewards: new Func<[accountId: bigint, poolId: bigint, collateralType: string, distributor: string], {accountId: bigint, poolId: bigint, collateralType: string, distributor: string}, bigint>( + abi, '0x460d2049' + ), + distributeRewards: new Func<[poolId: bigint, collateralType: string, amount: bigint, start: bigint, duration: number], {poolId: bigint, collateralType: string, amount: bigint, start: bigint, duration: number}, []>( + abi, '0x5a7ff7c5' + ), + getAvailableRewards: new Func<[accountId: bigint, poolId: bigint, collateralType: string, distributor: string], {accountId: bigint, poolId: bigint, collateralType: string, distributor: string}, bigint>( + abi, '0xc4b3410e' + ), + getRewardRate: new Func<[poolId: bigint, collateralType: string, distributor: string], {poolId: bigint, collateralType: string, distributor: string}, bigint>( + abi, '0x0dd2395a' + ), + registerRewardsDistributor: new Func<[poolId: bigint, collateralType: string, distributor: string], {poolId: bigint, collateralType: string, distributor: string}, []>( + abi, '0x170c1351' + ), + removeRewardsDistributor: new Func<[poolId: bigint, collateralType: string, distributor: string], {poolId: bigint, collateralType: string, distributor: string}, []>( + abi, '0x2685f42b' + ), + updateRewards: new Func<[poolId: bigint, collateralType: string, accountId: bigint], {poolId: bigint, collateralType: string, accountId: bigint}, [_: Array, _: Array]>( + abi, '0x645657d8' + ), + configureChainlinkCrossChain: new Func<[ccipRouter: string, ccipTokenPool: string], {ccipRouter: string, ccipTokenPool: string}, []>( + abi, '0x10d52805' + ), + configureOracleManager: new Func<[oracleManagerAddress: string], {oracleManagerAddress: string}, []>( + abi, '0xa5d49393' + ), + getConfig: new Func<[k: string], {k: string}, string>( + abi, '0x6dd5b69d' + ), + getConfigAddress: new Func<[k: string], {k: string}, string>( + abi, '0xf896503a' + ), + getConfigUint: new Func<[k: string], {k: string}, bigint>( + abi, '0xf92bb8c9' + ), + getTrustedForwarder: new Func<[], {}, string>( + abi, '0xce1b815f' + ), + isTrustedForwarder: new Func<[forwarder: string], {forwarder: string}, boolean>( + abi, '0x572b6c05' + ), + setConfig: new Func<[k: string, v: string], {k: string, v: string}, []>( + abi, '0xd1fd27b3' + ), + setSupportedCrossChainNetworks: new Func<[supportedNetworks: Array, ccipSelectors: Array], {supportedNetworks: Array, ccipSelectors: Array}, bigint>( + abi, '0x830e23b5' + ), + supportsInterface: new Func<[interfaceId: string], {interfaceId: string}, boolean>( + abi, '0x01ffc9a7' + ), + delegateCollateral: new Func<[accountId: bigint, poolId: bigint, collateralType: string, newCollateralAmountD18: bigint, leverage: bigint], {accountId: bigint, poolId: bigint, collateralType: string, newCollateralAmountD18: bigint, leverage: bigint}, []>( + abi, '0x7b0532a4' + ), + getPosition: new Func<[accountId: bigint, poolId: bigint, collateralType: string], {accountId: bigint, poolId: bigint, collateralType: string}, ([collateralAmount: bigint, collateralValue: bigint, debt: bigint, collateralizationRatio: bigint] & {collateralAmount: bigint, collateralValue: bigint, debt: bigint, collateralizationRatio: bigint})>( + abi, '0xf544d66e' + ), + getPositionCollateral: new Func<[accountId: bigint, poolId: bigint, collateralType: string], {accountId: bigint, poolId: bigint, collateralType: string}, bigint>( + abi, '0x33cc422b' + ), + getPositionCollateralRatio: new Func<[accountId: bigint, poolId: bigint, collateralType: string], {accountId: bigint, poolId: bigint, collateralType: string}, bigint>( + abi, '0xdc0a5384' + ), + getPositionDebt: new Func<[accountId: bigint, poolId: bigint, collateralType: string], {accountId: bigint, poolId: bigint, collateralType: string}, bigint>( + abi, '0x3593bbd2' + ), + getVaultCollateral: new Func<[poolId: bigint, collateralType: string], {poolId: bigint, collateralType: string}, ([amount: bigint, value: bigint] & {amount: bigint, value: bigint})>( + abi, '0x078145a8' + ), + getVaultCollateralRatio: new Func<[poolId: bigint, collateralType: string], {poolId: bigint, collateralType: string}, bigint>( + abi, '0x60248c55' + ), + getVaultDebt: new Func<[poolId: bigint, collateralType: string], {poolId: bigint, collateralType: string}, bigint>( + abi, '0x2fb8ff24' + ), +} + +export class Contract extends ContractBase { + + getImplementation(): Promise { + return this.eth_call(functions.getImplementation, []) + } + + nominatedOwner(): Promise { + return this.eth_call(functions.nominatedOwner, []) + } + + owner(): Promise { + return this.eth_call(functions.owner, []) + } + + getDeniers(feature: string): Promise> { + return this.eth_call(functions.getDeniers, [feature]) + } + + getFeatureFlagAllowAll(feature: string): Promise { + return this.eth_call(functions.getFeatureFlagAllowAll, [feature]) + } + + getFeatureFlagAllowlist(feature: string): Promise> { + return this.eth_call(functions.getFeatureFlagAllowlist, [feature]) + } + + getFeatureFlagDenyAll(feature: string): Promise { + return this.eth_call(functions.getFeatureFlagDenyAll, [feature]) + } + + isFeatureAllowed(feature: string, account: string): Promise { + return this.eth_call(functions.isFeatureAllowed, [feature, account]) + } + + getAccountLastInteraction(accountId: bigint): Promise { + return this.eth_call(functions.getAccountLastInteraction, [accountId]) + } + + getAccountOwner(accountId: bigint): Promise { + return this.eth_call(functions.getAccountOwner, [accountId]) + } + + getAccountPermissions(accountId: bigint): Promise] & {user: string, permissions: Array})>> { + return this.eth_call(functions.getAccountPermissions, [accountId]) + } + + getAccountTokenAddress(): Promise { + return this.eth_call(functions.getAccountTokenAddress, []) + } + + hasPermission(accountId: bigint, permission: string, user: string): Promise { + return this.eth_call(functions.hasPermission, [accountId, permission, user]) + } + + isAuthorized(accountId: bigint, permission: string, user: string): Promise { + return this.eth_call(functions.isAuthorized, [accountId, permission, user]) + } + + getAssociatedSystem(id: string): Promise<([addr: string, kind: string] & {addr: string, kind: string})> { + return this.eth_call(functions.getAssociatedSystem, [id]) + } + + getAccountAvailableCollateral(accountId: bigint, collateralType: string): Promise { + return this.eth_call(functions.getAccountAvailableCollateral, [accountId, collateralType]) + } + + getAccountCollateral(accountId: bigint, collateralType: string): Promise<([totalDeposited: bigint, totalAssigned: bigint, totalLocked: bigint] & {totalDeposited: bigint, totalAssigned: bigint, totalLocked: bigint})> { + return this.eth_call(functions.getAccountCollateral, [accountId, collateralType]) + } + + getLocks(accountId: bigint, collateralType: string, offset: bigint, count: bigint): Promise> { + return this.eth_call(functions.getLocks, [accountId, collateralType, offset, count]) + } + + getCollateralConfiguration(collateralType: string): Promise<([depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint] & {depositingEnabled: boolean, issuanceRatioD18: bigint, liquidationRatioD18: bigint, liquidationRewardD18: bigint, oracleNodeId: string, tokenAddress: string, minDelegationD18: bigint})> { + return this.eth_call(functions.getCollateralConfiguration, [collateralType]) + } + + getCollateralConfigurations(hideDisabled: boolean): Promise> { + return this.eth_call(functions.getCollateralConfigurations, [hideDisabled]) + } + + getCollateralPrice(collateralType: string): Promise { + return this.eth_call(functions.getCollateralPrice, [collateralType]) + } + + getMarketCollateralAmount(marketId: bigint, collateralType: string): Promise { + return this.eth_call(functions.getMarketCollateralAmount, [marketId, collateralType]) + } + + getMarketCollateralValue(marketId: bigint): Promise { + return this.eth_call(functions.getMarketCollateralValue, [marketId]) + } + + getMaximumMarketCollateral(marketId: bigint, collateralType: string): Promise { + return this.eth_call(functions.getMaximumMarketCollateral, [marketId, collateralType]) + } + + getMarketAddress(marketId: bigint): Promise { + return this.eth_call(functions.getMarketAddress, [marketId]) + } + + getMarketCollateral(marketId: bigint): Promise { + return this.eth_call(functions.getMarketCollateral, [marketId]) + } + + getMarketFees(arg0: bigint, amount: bigint): Promise<([depositFeeAmount: bigint, withdrawFeeAmount: bigint] & {depositFeeAmount: bigint, withdrawFeeAmount: bigint})> { + return this.eth_call(functions.getMarketFees, [arg0, amount]) + } + + getMarketMinDelegateTime(marketId: bigint): Promise { + return this.eth_call(functions.getMarketMinDelegateTime, [marketId]) + } + + getMarketNetIssuance(marketId: bigint): Promise { + return this.eth_call(functions.getMarketNetIssuance, [marketId]) + } + + getMarketReportedDebt(marketId: bigint): Promise { + return this.eth_call(functions.getMarketReportedDebt, [marketId]) + } + + getMarketTotalDebt(marketId: bigint): Promise { + return this.eth_call(functions.getMarketTotalDebt, [marketId]) + } + + 'getMinLiquidityRatio(uint128)'(marketId: bigint): Promise { + return this.eth_call(functions['getMinLiquidityRatio(uint128)'], [marketId]) + } + + getOracleManager(): Promise { + return this.eth_call(functions.getOracleManager, []) + } + + getUsdToken(): Promise { + return this.eth_call(functions.getUsdToken, []) + } + + getWithdrawableMarketUsd(marketId: bigint): Promise { + return this.eth_call(functions.getWithdrawableMarketUsd, [marketId]) + } + + isMarketCapacityLocked(marketId: bigint): Promise { + return this.eth_call(functions.isMarketCapacityLocked, [marketId]) + } + + getApprovedPools(): Promise> { + return this.eth_call(functions.getApprovedPools, []) + } + + getPreferredPool(): Promise { + return this.eth_call(functions.getPreferredPool, []) + } + + 'getMinLiquidityRatio()'(): Promise { + return this.eth_call(functions['getMinLiquidityRatio()'], []) + } + + getNominatedPoolOwner(poolId: bigint): Promise { + return this.eth_call(functions.getNominatedPoolOwner, [poolId]) + } + + getPoolCollateralConfiguration(poolId: bigint, collateralType: string): Promise<([collateralLimitD18: bigint, issuanceRatioD18: bigint] & {collateralLimitD18: bigint, issuanceRatioD18: bigint})> { + return this.eth_call(functions.getPoolCollateralConfiguration, [poolId, collateralType]) + } + + getPoolCollateralIssuanceRatio(poolId: bigint, collateral: string): Promise { + return this.eth_call(functions.getPoolCollateralIssuanceRatio, [poolId, collateral]) + } + + getPoolConfiguration(poolId: bigint): Promise> { + return this.eth_call(functions.getPoolConfiguration, [poolId]) + } + + getPoolName(poolId: bigint): Promise { + return this.eth_call(functions.getPoolName, [poolId]) + } + + getPoolOwner(poolId: bigint): Promise { + return this.eth_call(functions.getPoolOwner, [poolId]) + } + + getAvailableRewards(accountId: bigint, poolId: bigint, collateralType: string, distributor: string): Promise { + return this.eth_call(functions.getAvailableRewards, [accountId, poolId, collateralType, distributor]) + } + + getRewardRate(poolId: bigint, collateralType: string, distributor: string): Promise { + return this.eth_call(functions.getRewardRate, [poolId, collateralType, distributor]) + } + + getConfig(k: string): Promise { + return this.eth_call(functions.getConfig, [k]) + } + + getConfigAddress(k: string): Promise { + return this.eth_call(functions.getConfigAddress, [k]) + } + + getConfigUint(k: string): Promise { + return this.eth_call(functions.getConfigUint, [k]) + } + + getTrustedForwarder(): Promise { + return this.eth_call(functions.getTrustedForwarder, []) + } + + isTrustedForwarder(forwarder: string): Promise { + return this.eth_call(functions.isTrustedForwarder, [forwarder]) + } + + supportsInterface(interfaceId: string): Promise { + return this.eth_call(functions.supportsInterface, [interfaceId]) + } + + getPositionCollateral(accountId: bigint, poolId: bigint, collateralType: string): Promise { + return this.eth_call(functions.getPositionCollateral, [accountId, poolId, collateralType]) + } + + getVaultCollateral(poolId: bigint, collateralType: string): Promise<([amount: bigint, value: bigint] & {amount: bigint, value: bigint})> { + return this.eth_call(functions.getVaultCollateral, [poolId, collateralType]) + } +} diff --git a/indexers/arbitrum-sepolia/src/abi/PerpsAccountProxy.abi.ts b/indexers/arbitrum-sepolia/src/abi/PerpsAccountProxy.abi.ts new file mode 100644 index 00000000..8816fca7 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/abi/PerpsAccountProxy.abi.ts @@ -0,0 +1,773 @@ +export const ABI_JSON = [ + { + "type": "error", + "name": "ImplementationIsSterile", + "inputs": [ + { + "type": "address", + "name": "implementation" + } + ] + }, + { + "type": "error", + "name": "NoChange", + "inputs": [] + }, + { + "type": "error", + "name": "NotAContract", + "inputs": [ + { + "type": "address", + "name": "contr" + } + ] + }, + { + "type": "error", + "name": "NotNominated", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "Unauthorized", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "UpgradeSimulationFailed", + "inputs": [] + }, + { + "type": "error", + "name": "ZeroAddress", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "OwnerChanged", + "inputs": [ + { + "type": "address", + "name": "oldOwner", + "indexed": false + }, + { + "type": "address", + "name": "newOwner", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "OwnerNominated", + "inputs": [ + { + "type": "address", + "name": "newOwner", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Upgraded", + "inputs": [ + { + "type": "address", + "name": "self", + "indexed": true + }, + { + "type": "address", + "name": "implementation", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "acceptOwnership", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "getImplementation", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "nominateNewOwner", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newNominatedOwner" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "nominatedOwner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "owner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "renounceNomination", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "simulateUpgradeTo", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newImplementation" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "upgradeTo", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newImplementation" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "AlreadyInitialized", + "inputs": [] + }, + { + "type": "error", + "name": "CannotSelfApprove", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "IndexOverrun", + "inputs": [ + { + "type": "uint256", + "name": "requestedIndex" + }, + { + "type": "uint256", + "name": "length" + } + ] + }, + { + "type": "error", + "name": "InvalidOwner", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "InvalidParameter", + "inputs": [ + { + "type": "string", + "name": "parameter" + }, + { + "type": "string", + "name": "reason" + } + ] + }, + { + "type": "error", + "name": "InvalidTransferRecipient", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "OverflowUint256ToUint128", + "inputs": [] + }, + { + "type": "error", + "name": "TokenAlreadyMinted", + "inputs": [ + { + "type": "uint256", + "name": "id" + } + ] + }, + { + "type": "error", + "name": "TokenDoesNotExist", + "inputs": [ + { + "type": "uint256", + "name": "id" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Approval", + "inputs": [ + { + "type": "address", + "name": "owner", + "indexed": true + }, + { + "type": "address", + "name": "approved", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenId", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "ApprovalForAll", + "inputs": [ + { + "type": "address", + "name": "owner", + "indexed": true + }, + { + "type": "address", + "name": "operator", + "indexed": true + }, + { + "type": "bool", + "name": "approved", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Transfer", + "inputs": [ + { + "type": "address", + "name": "from", + "indexed": true + }, + { + "type": "address", + "name": "to", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenId", + "indexed": true + } + ] + }, + { + "type": "function", + "name": "approve", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "balanceOf", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "holder" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "balance" + } + ] + }, + { + "type": "function", + "name": "burn", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getApproved", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [ + { + "type": "address", + "name": "operator" + } + ] + }, + { + "type": "function", + "name": "initialize", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "string", + "name": "tokenName" + }, + { + "type": "string", + "name": "tokenSymbol" + }, + { + "type": "string", + "name": "uri" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "isApprovedForAll", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "holder" + }, + { + "type": "address", + "name": "operator" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isInitialized", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "mint", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "name", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "ownerOf", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "safeMint", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + }, + { + "type": "bytes", + "name": "data" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "safeTransferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "safeTransferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + }, + { + "type": "bytes", + "name": "data" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setAllowance", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + }, + { + "type": "address", + "name": "spender" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setApprovalForAll", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "operator" + }, + { + "type": "bool", + "name": "approved" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setBaseTokenURI", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "string", + "name": "uri" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "supportsInterface", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes4", + "name": "interfaceId" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "symbol", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "tokenByIndex", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "index" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "tokenOfOwnerByIndex", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "owner" + }, + { + "type": "uint256", + "name": "index" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "tokenURI", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "totalSupply", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "transferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + } +] diff --git a/indexers/arbitrum-sepolia/src/abi/PerpsAccountProxy.ts b/indexers/arbitrum-sepolia/src/abi/PerpsAccountProxy.ts new file mode 100644 index 00000000..c721a688 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/abi/PerpsAccountProxy.ts @@ -0,0 +1,185 @@ +import * as ethers from 'ethers' +import {LogEvent, Func, ContractBase} from './abi.support' +import {ABI_JSON} from './PerpsAccountProxy.abi' + +export const abi = new ethers.Interface(ABI_JSON); + +export const events = { + OwnerChanged: new LogEvent<([oldOwner: string, newOwner: string] & {oldOwner: string, newOwner: string})>( + abi, '0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c' + ), + OwnerNominated: new LogEvent<([newOwner: string] & {newOwner: string})>( + abi, '0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22' + ), + Upgraded: new LogEvent<([self: string, implementation: string] & {self: string, implementation: string})>( + abi, '0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7' + ), + Approval: new LogEvent<([owner: string, approved: string, tokenId: bigint] & {owner: string, approved: string, tokenId: bigint})>( + abi, '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925' + ), + ApprovalForAll: new LogEvent<([owner: string, operator: string, approved: boolean] & {owner: string, operator: string, approved: boolean})>( + abi, '0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31' + ), + Transfer: new LogEvent<([from: string, to: string, tokenId: bigint] & {from: string, to: string, tokenId: bigint})>( + abi, '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' + ), +} + +export const functions = { + acceptOwnership: new Func<[], {}, []>( + abi, '0x79ba5097' + ), + getImplementation: new Func<[], {}, string>( + abi, '0xaaf10f42' + ), + nominateNewOwner: new Func<[newNominatedOwner: string], {newNominatedOwner: string}, []>( + abi, '0x1627540c' + ), + nominatedOwner: new Func<[], {}, string>( + abi, '0x53a47bb7' + ), + owner: new Func<[], {}, string>( + abi, '0x8da5cb5b' + ), + renounceNomination: new Func<[], {}, []>( + abi, '0x718fe928' + ), + simulateUpgradeTo: new Func<[newImplementation: string], {newImplementation: string}, []>( + abi, '0xc7f62cda' + ), + upgradeTo: new Func<[newImplementation: string], {newImplementation: string}, []>( + abi, '0x3659cfe6' + ), + approve: new Func<[to: string, tokenId: bigint], {to: string, tokenId: bigint}, []>( + abi, '0x095ea7b3' + ), + balanceOf: new Func<[holder: string], {holder: string}, bigint>( + abi, '0x70a08231' + ), + burn: new Func<[tokenId: bigint], {tokenId: bigint}, []>( + abi, '0x42966c68' + ), + getApproved: new Func<[tokenId: bigint], {tokenId: bigint}, string>( + abi, '0x081812fc' + ), + initialize: new Func<[tokenName: string, tokenSymbol: string, uri: string], {tokenName: string, tokenSymbol: string, uri: string}, []>( + abi, '0xa6487c53' + ), + isApprovedForAll: new Func<[holder: string, operator: string], {holder: string, operator: string}, boolean>( + abi, '0xe985e9c5' + ), + isInitialized: new Func<[], {}, boolean>( + abi, '0x392e53cd' + ), + mint: new Func<[to: string, tokenId: bigint], {to: string, tokenId: bigint}, []>( + abi, '0x40c10f19' + ), + name: new Func<[], {}, string>( + abi, '0x06fdde03' + ), + ownerOf: new Func<[tokenId: bigint], {tokenId: bigint}, string>( + abi, '0x6352211e' + ), + safeMint: new Func<[to: string, tokenId: bigint, data: string], {to: string, tokenId: bigint, data: string}, []>( + abi, '0x8832e6e3' + ), + 'safeTransferFrom(address,address,uint256)': new Func<[from: string, to: string, tokenId: bigint], {from: string, to: string, tokenId: bigint}, []>( + abi, '0x42842e0e' + ), + 'safeTransferFrom(address,address,uint256,bytes)': new Func<[from: string, to: string, tokenId: bigint, data: string], {from: string, to: string, tokenId: bigint, data: string}, []>( + abi, '0xb88d4fde' + ), + setAllowance: new Func<[tokenId: bigint, spender: string], {tokenId: bigint, spender: string}, []>( + abi, '0xff53fac7' + ), + setApprovalForAll: new Func<[operator: string, approved: boolean], {operator: string, approved: boolean}, []>( + abi, '0xa22cb465' + ), + setBaseTokenURI: new Func<[uri: string], {uri: string}, []>( + abi, '0x30176e13' + ), + supportsInterface: new Func<[interfaceId: string], {interfaceId: string}, boolean>( + abi, '0x01ffc9a7' + ), + symbol: new Func<[], {}, string>( + abi, '0x95d89b41' + ), + tokenByIndex: new Func<[index: bigint], {index: bigint}, bigint>( + abi, '0x4f6ccce7' + ), + tokenOfOwnerByIndex: new Func<[owner: string, index: bigint], {owner: string, index: bigint}, bigint>( + abi, '0x2f745c59' + ), + tokenURI: new Func<[tokenId: bigint], {tokenId: bigint}, string>( + abi, '0xc87b56dd' + ), + totalSupply: new Func<[], {}, bigint>( + abi, '0x18160ddd' + ), + transferFrom: new Func<[from: string, to: string, tokenId: bigint], {from: string, to: string, tokenId: bigint}, []>( + abi, '0x23b872dd' + ), +} + +export class Contract extends ContractBase { + + getImplementation(): Promise { + return this.eth_call(functions.getImplementation, []) + } + + nominatedOwner(): Promise { + return this.eth_call(functions.nominatedOwner, []) + } + + owner(): Promise { + return this.eth_call(functions.owner, []) + } + + balanceOf(holder: string): Promise { + return this.eth_call(functions.balanceOf, [holder]) + } + + getApproved(tokenId: bigint): Promise { + return this.eth_call(functions.getApproved, [tokenId]) + } + + isApprovedForAll(holder: string, operator: string): Promise { + return this.eth_call(functions.isApprovedForAll, [holder, operator]) + } + + isInitialized(): Promise { + return this.eth_call(functions.isInitialized, []) + } + + name(): Promise { + return this.eth_call(functions.name, []) + } + + ownerOf(tokenId: bigint): Promise { + return this.eth_call(functions.ownerOf, [tokenId]) + } + + supportsInterface(interfaceId: string): Promise { + return this.eth_call(functions.supportsInterface, [interfaceId]) + } + + symbol(): Promise { + return this.eth_call(functions.symbol, []) + } + + tokenByIndex(index: bigint): Promise { + return this.eth_call(functions.tokenByIndex, [index]) + } + + tokenOfOwnerByIndex(owner: string, index: bigint): Promise { + return this.eth_call(functions.tokenOfOwnerByIndex, [owner, index]) + } + + tokenURI(tokenId: bigint): Promise { + return this.eth_call(functions.tokenURI, [tokenId]) + } + + totalSupply(): Promise { + return this.eth_call(functions.totalSupply, []) + } +} diff --git a/indexers/arbitrum-sepolia/src/abi/PerpsMarketProxy.abi.ts b/indexers/arbitrum-sepolia/src/abi/PerpsMarketProxy.abi.ts new file mode 100644 index 00000000..bdf3150a --- /dev/null +++ b/indexers/arbitrum-sepolia/src/abi/PerpsMarketProxy.abi.ts @@ -0,0 +1,4627 @@ +export const ABI_JSON = [ + { + "type": "error", + "name": "FeatureUnavailable", + "inputs": [ + { + "type": "bytes32", + "name": "which" + } + ] + }, + { + "type": "error", + "name": "InvalidAccountId", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ] + }, + { + "type": "error", + "name": "InvalidPermission", + "inputs": [ + { + "type": "bytes32", + "name": "permission" + } + ] + }, + { + "type": "error", + "name": "OnlyAccountTokenProxy", + "inputs": [ + { + "type": "address", + "name": "origin" + } + ] + }, + { + "type": "error", + "name": "PermissionDenied", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + }, + { + "type": "address", + "name": "target" + } + ] + }, + { + "type": "error", + "name": "PermissionNotGranted", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + }, + { + "type": "address", + "name": "user" + } + ] + }, + { + "type": "error", + "name": "PositionOutOfBounds", + "inputs": [] + }, + { + "type": "error", + "name": "ValueAlreadyInSet", + "inputs": [] + }, + { + "type": "error", + "name": "ValueNotInSet", + "inputs": [] + }, + { + "type": "error", + "name": "ZeroAddress", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "AccountCreated", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "address", + "name": "owner", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PermissionGranted", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "bytes32", + "name": "permission", + "indexed": true + }, + { + "type": "address", + "name": "user", + "indexed": true + }, + { + "type": "address", + "name": "sender", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PermissionRevoked", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "bytes32", + "name": "permission", + "indexed": true + }, + { + "type": "address", + "name": "user", + "indexed": true + }, + { + "type": "address", + "name": "sender", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "createAccount", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint128", + "name": "accountId" + } + ] + }, + { + "type": "function", + "name": "createAccount", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "requestedAccountId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getAccountLastInteraction", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getAccountOwner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getAccountPermissions", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "tuple[]", + "name": "accountPerms", + "components": [ + { + "type": "address", + "name": "user" + }, + { + "type": "bytes32[]", + "name": "permissions" + } + ] + } + ] + }, + { + "type": "function", + "name": "getAccountTokenAddress", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "grantPermission", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + }, + { + "type": "address", + "name": "user" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "hasPermission", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + }, + { + "type": "address", + "name": "user" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isAuthorized", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + }, + { + "type": "address", + "name": "user" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "notifyAccountTransfer", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "to" + }, + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "renouncePermission", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "revokePermission", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "bytes32", + "name": "permission" + }, + { + "type": "address", + "name": "user" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "MismatchAssociatedSystemKind", + "inputs": [ + { + "type": "bytes32", + "name": "expected" + }, + { + "type": "bytes32", + "name": "actual" + } + ] + }, + { + "type": "error", + "name": "MissingAssociatedSystem", + "inputs": [ + { + "type": "bytes32", + "name": "id" + } + ] + }, + { + "type": "error", + "name": "Unauthorized", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "AssociatedSystemSet", + "inputs": [ + { + "type": "bytes32", + "name": "kind", + "indexed": true + }, + { + "type": "bytes32", + "name": "id", + "indexed": true + }, + { + "type": "address", + "name": "proxy", + "indexed": false + }, + { + "type": "address", + "name": "impl", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "getAssociatedSystem", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "id" + } + ], + "outputs": [ + { + "type": "address", + "name": "addr" + }, + { + "type": "bytes32", + "name": "kind" + } + ] + }, + { + "type": "function", + "name": "initOrUpgradeNft", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "id" + }, + { + "type": "string", + "name": "name" + }, + { + "type": "string", + "name": "symbol" + }, + { + "type": "string", + "name": "uri" + }, + { + "type": "address", + "name": "impl" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "initOrUpgradeToken", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "id" + }, + { + "type": "string", + "name": "name" + }, + { + "type": "string", + "name": "symbol" + }, + { + "type": "uint8", + "name": "decimals" + }, + { + "type": "address", + "name": "impl" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "registerUnmanagedSystem", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "id" + }, + { + "type": "address", + "name": "endpoint" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "ImplementationIsSterile", + "inputs": [ + { + "type": "address", + "name": "implementation" + } + ] + }, + { + "type": "error", + "name": "NoChange", + "inputs": [] + }, + { + "type": "error", + "name": "NotAContract", + "inputs": [ + { + "type": "address", + "name": "contr" + } + ] + }, + { + "type": "error", + "name": "NotNominated", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "UpgradeSimulationFailed", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "OwnerChanged", + "inputs": [ + { + "type": "address", + "name": "oldOwner", + "indexed": false + }, + { + "type": "address", + "name": "newOwner", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "OwnerNominated", + "inputs": [ + { + "type": "address", + "name": "newOwner", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Upgraded", + "inputs": [ + { + "type": "address", + "name": "self", + "indexed": true + }, + { + "type": "address", + "name": "implementation", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "acceptOwnership", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "getImplementation", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "nominateNewOwner", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newNominatedOwner" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "nominatedOwner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "owner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "renounceNomination", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "simulateUpgradeTo", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newImplementation" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "upgradeTo", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newImplementation" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "InvalidMarket", + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ] + }, + { + "type": "error", + "name": "InvalidParameter", + "inputs": [ + { + "type": "string", + "name": "parameter" + }, + { + "type": "string", + "name": "reason" + } + ] + }, + { + "type": "error", + "name": "OverflowInt256ToUint256", + "inputs": [] + }, + { + "type": "error", + "name": "OverflowUint256ToInt256", + "inputs": [] + }, + { + "type": "error", + "name": "OverflowUint256ToUint128", + "inputs": [] + }, + { + "type": "error", + "name": "PerpsMarketAlreadyInitialized", + "inputs": [] + }, + { + "type": "error", + "name": "PerpsMarketNotInitialized", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "FactoryInitialized", + "inputs": [ + { + "type": "uint128", + "name": "globalPerpsMarketId", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketCreated", + "inputs": [ + { + "type": "uint128", + "name": "perpsMarketId", + "indexed": true + }, + { + "type": "string", + "name": "marketName", + "indexed": false + }, + { + "type": "string", + "name": "marketSymbol", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "createMarket", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "requestedMarketId" + }, + { + "type": "string", + "name": "marketName" + }, + { + "type": "string", + "name": "marketSymbol" + } + ], + "outputs": [ + { + "type": "uint128", + "name": "" + } + ] + }, + { + "type": "function", + "name": "initializeFactory", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "synthetix" + }, + { + "type": "address", + "name": "spotMarket" + } + ], + "outputs": [ + { + "type": "uint128", + "name": "" + } + ] + }, + { + "type": "function", + "name": "interestRate", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint128", + "name": "" + } + ] + }, + { + "type": "function", + "name": "minimumCredit", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "perpsMarketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "name", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "perpsMarketId" + } + ], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "reportedDebt", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "perpsMarketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "setPerpsMarketName", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "string", + "name": "marketName" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "supportsInterface", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes4", + "name": "interfaceId" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "utilizationRate", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "rate" + }, + { + "type": "uint256", + "name": "delegatedCollateral" + }, + { + "type": "uint256", + "name": "lockedCredit" + } + ] + }, + { + "type": "error", + "name": "AccountLiquidatable", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ] + }, + { + "type": "error", + "name": "AccountNotFound", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ] + }, + { + "type": "error", + "name": "InsufficientCollateral", + "inputs": [ + { + "type": "uint128", + "name": "collateralId" + }, + { + "type": "uint256", + "name": "collateralAmount" + }, + { + "type": "uint256", + "name": "withdrawAmount" + } + ] + }, + { + "type": "error", + "name": "InsufficientCollateralAvailableForWithdraw", + "inputs": [ + { + "type": "int256", + "name": "withdrawableMarginUsd" + }, + { + "type": "uint256", + "name": "requestedMarginUsd" + } + ] + }, + { + "type": "error", + "name": "InsufficientSynthCollateral", + "inputs": [ + { + "type": "uint128", + "name": "collateralId" + }, + { + "type": "uint256", + "name": "collateralAmount" + }, + { + "type": "uint256", + "name": "withdrawAmount" + } + ] + }, + { + "type": "error", + "name": "InvalidAmountDelta", + "inputs": [ + { + "type": "int256", + "name": "amountDelta" + } + ] + }, + { + "type": "error", + "name": "InvalidId", + "inputs": [ + { + "type": "uint128", + "name": "id" + } + ] + }, + { + "type": "error", + "name": "KeeperCostsNotSet", + "inputs": [] + }, + { + "type": "error", + "name": "MaxCollateralExceeded", + "inputs": [ + { + "type": "uint128", + "name": "collateralId" + }, + { + "type": "uint256", + "name": "maxAmount" + }, + { + "type": "uint256", + "name": "collateralAmount" + }, + { + "type": "uint256", + "name": "depositAmount" + } + ] + }, + { + "type": "error", + "name": "MaxCollateralsPerAccountReached", + "inputs": [ + { + "type": "uint128", + "name": "maxCollateralsPerAccount" + } + ] + }, + { + "type": "error", + "name": "NonexistentDebt", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ] + }, + { + "type": "error", + "name": "OverflowUint128ToInt128", + "inputs": [] + }, + { + "type": "error", + "name": "PendingOrderExists", + "inputs": [] + }, + { + "type": "error", + "name": "PriceFeedNotSet", + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ] + }, + { + "type": "error", + "name": "SynthNotEnabledForCollateral", + "inputs": [ + { + "type": "uint128", + "name": "collateralId" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "CollateralModified", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint128", + "name": "collateralId", + "indexed": true + }, + { + "type": "int256", + "name": "amountDelta", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "DebtPaid", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint256", + "name": "amount", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "InterestRateUpdated", + "inputs": [ + { + "type": "uint128", + "name": "superMarketId", + "indexed": true + }, + { + "type": "uint128", + "name": "interestRate", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "debt", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "accountDebt" + } + ] + }, + { + "type": "function", + "name": "getAccountCollateralIds", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "uint256[]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getAccountOpenPositions", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "uint256[]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getAvailableMargin", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "int256", + "name": "availableMargin" + } + ] + }, + { + "type": "function", + "name": "getCollateralAmount", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "collateralId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getOpenPosition", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "int256", + "name": "totalPnl" + }, + { + "type": "int256", + "name": "accruedFunding" + }, + { + "type": "int128", + "name": "positionSize" + }, + { + "type": "uint256", + "name": "owedInterest" + } + ] + }, + { + "type": "function", + "name": "getOpenPositionSize", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "int128", + "name": "positionSize" + } + ] + }, + { + "type": "function", + "name": "getRequiredMargins", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "requiredInitialMargin" + }, + { + "type": "uint256", + "name": "requiredMaintenanceMargin" + }, + { + "type": "uint256", + "name": "maxLiquidationReward" + } + ] + }, + { + "type": "function", + "name": "getWithdrawableMargin", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "int256", + "name": "withdrawableMargin" + } + ] + }, + { + "type": "function", + "name": "modifyCollateral", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "collateralId" + }, + { + "type": "int256", + "name": "amountDelta" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "payDebt", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint256", + "name": "amount" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "totalAccountOpenInterest", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "totalCollateralValue", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "currentFundingRate", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "int256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "currentFundingVelocity", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "int256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "fillPrice", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "int128", + "name": "orderSize" + }, + { + "type": "uint256", + "name": "price" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getMarketSummary", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "tuple", + "name": "summary", + "components": [ + { + "type": "int256", + "name": "skew" + }, + { + "type": "uint256", + "name": "size" + }, + { + "type": "uint256", + "name": "maxOpenInterest" + }, + { + "type": "int256", + "name": "currentFundingRate" + }, + { + "type": "int256", + "name": "currentFundingVelocity" + }, + { + "type": "uint256", + "name": "indexPrice" + } + ] + } + ] + }, + { + "type": "function", + "name": "indexPrice", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "maxOpenInterest", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "metadata", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "string", + "name": "name" + }, + { + "type": "string", + "name": "symbol" + } + ] + }, + { + "type": "function", + "name": "size", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "skew", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "int256", + "name": "" + } + ] + }, + { + "type": "error", + "name": "ExceedsMarketCreditCapacity", + "inputs": [ + { + "type": "int256", + "name": "delegatedCollateral" + }, + { + "type": "int256", + "name": "newLockedCredit" + } + ] + }, + { + "type": "error", + "name": "InsufficientMargin", + "inputs": [ + { + "type": "int256", + "name": "availableMargin" + }, + { + "type": "uint256", + "name": "minMargin" + } + ] + }, + { + "type": "error", + "name": "InvalidSettlementStrategy", + "inputs": [ + { + "type": "uint256", + "name": "settlementStrategyId" + } + ] + }, + { + "type": "error", + "name": "MaxOpenInterestReached", + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "maxMarketSize" + }, + { + "type": "int256", + "name": "newSideSize" + } + ] + }, + { + "type": "error", + "name": "MaxPositionsPerAccountReached", + "inputs": [ + { + "type": "uint128", + "name": "maxPositionsPerAccount" + } + ] + }, + { + "type": "error", + "name": "MaxUSDOpenInterestReached", + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "maxMarketValue" + }, + { + "type": "int256", + "name": "newSideSize" + }, + { + "type": "uint256", + "name": "price" + } + ] + }, + { + "type": "error", + "name": "OverflowInt256ToInt128", + "inputs": [] + }, + { + "type": "error", + "name": "ZeroSizeOrder", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "OrderCommitted", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint8", + "name": "orderType", + "indexed": false + }, + { + "type": "int128", + "name": "sizeDelta", + "indexed": false + }, + { + "type": "uint256", + "name": "acceptablePrice", + "indexed": false + }, + { + "type": "uint256", + "name": "commitmentTime", + "indexed": false + }, + { + "type": "uint256", + "name": "expectedPriceTime", + "indexed": false + }, + { + "type": "uint256", + "name": "settlementTime", + "indexed": false + }, + { + "type": "uint256", + "name": "expirationTime", + "indexed": false + }, + { + "type": "bytes32", + "name": "trackingCode", + "indexed": true + }, + { + "type": "address", + "name": "sender", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PreviousOrderExpired", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "int128", + "name": "sizeDelta", + "indexed": false + }, + { + "type": "uint256", + "name": "acceptablePrice", + "indexed": false + }, + { + "type": "uint256", + "name": "commitmentTime", + "indexed": false + }, + { + "type": "bytes32", + "name": "trackingCode", + "indexed": true + } + ] + }, + { + "type": "function", + "name": "commitOrder", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "tuple", + "name": "commitment", + "components": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "int128", + "name": "sizeDelta" + }, + { + "type": "uint128", + "name": "settlementStrategyId" + }, + { + "type": "uint256", + "name": "acceptablePrice" + }, + { + "type": "bytes32", + "name": "trackingCode" + }, + { + "type": "address", + "name": "referrer" + } + ] + } + ], + "outputs": [ + { + "type": "tuple", + "name": "retOrder", + "components": [ + { + "type": "uint256", + "name": "commitmentTime" + }, + { + "type": "tuple", + "name": "request", + "components": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "int128", + "name": "sizeDelta" + }, + { + "type": "uint128", + "name": "settlementStrategyId" + }, + { + "type": "uint256", + "name": "acceptablePrice" + }, + { + "type": "bytes32", + "name": "trackingCode" + }, + { + "type": "address", + "name": "referrer" + } + ] + } + ] + }, + { + "type": "uint256", + "name": "fees" + } + ] + }, + { + "type": "function", + "name": "computeOrderFees", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "int128", + "name": "sizeDelta" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "orderFees" + }, + { + "type": "uint256", + "name": "fillPrice" + } + ] + }, + { + "type": "function", + "name": "computeOrderFeesWithPrice", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "int128", + "name": "sizeDelta" + }, + { + "type": "uint256", + "name": "price" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "orderFees" + }, + { + "type": "uint256", + "name": "fillPrice" + } + ] + }, + { + "type": "function", + "name": "getOrder", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "tuple", + "name": "order", + "components": [ + { + "type": "uint256", + "name": "commitmentTime" + }, + { + "type": "tuple", + "name": "request", + "components": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "int128", + "name": "sizeDelta" + }, + { + "type": "uint128", + "name": "settlementStrategyId" + }, + { + "type": "uint256", + "name": "acceptablePrice" + }, + { + "type": "bytes32", + "name": "trackingCode" + }, + { + "type": "address", + "name": "referrer" + } + ] + } + ] + } + ] + }, + { + "type": "function", + "name": "getSettlementRewardCost", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "settlementStrategyId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "requiredMarginForOrder", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "int128", + "name": "sizeDelta" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "requiredMargin" + } + ] + }, + { + "type": "function", + "name": "requiredMarginForOrderWithPrice", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "int128", + "name": "sizeDelta" + }, + { + "type": "uint256", + "name": "price" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "requiredMargin" + } + ] + }, + { + "type": "error", + "name": "AcceptablePriceExceeded", + "inputs": [ + { + "type": "uint256", + "name": "fillPrice" + }, + { + "type": "uint256", + "name": "acceptablePrice" + } + ] + }, + { + "type": "error", + "name": "OrderNotValid", + "inputs": [] + }, + { + "type": "error", + "name": "OverflowInt128ToUint128", + "inputs": [] + }, + { + "type": "error", + "name": "OverflowUint256ToUint64", + "inputs": [] + }, + { + "type": "error", + "name": "SettlementStrategyNotFound", + "inputs": [ + { + "type": "uint8", + "name": "strategyType" + } + ] + }, + { + "type": "error", + "name": "SettlementWindowExpired", + "inputs": [ + { + "type": "uint256", + "name": "timestamp" + }, + { + "type": "uint256", + "name": "settlementTime" + }, + { + "type": "uint256", + "name": "settlementExpiration" + } + ] + }, + { + "type": "error", + "name": "SettlementWindowNotOpen", + "inputs": [ + { + "type": "uint256", + "name": "timestamp" + }, + { + "type": "uint256", + "name": "settlementTime" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "AccountCharged", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": false + }, + { + "type": "int256", + "name": "amount", + "indexed": false + }, + { + "type": "uint256", + "name": "accountDebt", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "InterestCharged", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint256", + "name": "interest", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketUpdated", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": false + }, + { + "type": "uint256", + "name": "price", + "indexed": false + }, + { + "type": "int256", + "name": "skew", + "indexed": false + }, + { + "type": "uint256", + "name": "size", + "indexed": false + }, + { + "type": "int256", + "name": "sizeDelta", + "indexed": false + }, + { + "type": "int256", + "name": "currentFundingRate", + "indexed": false + }, + { + "type": "int256", + "name": "currentFundingVelocity", + "indexed": false + }, + { + "type": "uint128", + "name": "interestRate", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "OrderSettled", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint256", + "name": "fillPrice", + "indexed": false + }, + { + "type": "int256", + "name": "pnl", + "indexed": false + }, + { + "type": "int256", + "name": "accruedFunding", + "indexed": false + }, + { + "type": "int128", + "name": "sizeDelta", + "indexed": false + }, + { + "type": "int128", + "name": "newSize", + "indexed": false + }, + { + "type": "uint256", + "name": "totalFees", + "indexed": false + }, + { + "type": "uint256", + "name": "referralFees", + "indexed": false + }, + { + "type": "uint256", + "name": "collectedFees", + "indexed": false + }, + { + "type": "uint256", + "name": "settlementReward", + "indexed": false + }, + { + "type": "bytes32", + "name": "trackingCode", + "indexed": true + }, + { + "type": "address", + "name": "settler", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "settleOrder", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "AcceptablePriceNotExceeded", + "inputs": [ + { + "type": "uint256", + "name": "fillPrice" + }, + { + "type": "uint256", + "name": "acceptablePrice" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "OrderCancelled", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint256", + "name": "desiredPrice", + "indexed": false + }, + { + "type": "uint256", + "name": "fillPrice", + "indexed": false + }, + { + "type": "int128", + "name": "sizeDelta", + "indexed": false + }, + { + "type": "uint256", + "name": "settlementReward", + "indexed": false + }, + { + "type": "bytes32", + "name": "trackingCode", + "indexed": true + }, + { + "type": "address", + "name": "settler", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "cancelOrder", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagAllowAllSet", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "bool", + "name": "allowAll", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagAllowlistAdded", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "address", + "name": "account", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagAllowlistRemoved", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "address", + "name": "account", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagDeniersReset", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "address[]", + "name": "deniers" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagDenyAllSet", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "bool", + "name": "denyAll", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "addToFeatureFlagAllowlist", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getDeniers", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + } + ], + "outputs": [ + { + "type": "address[]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getFeatureFlagAllowAll", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getFeatureFlagAllowlist", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + } + ], + "outputs": [ + { + "type": "address[]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getFeatureFlagDenyAll", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isFeatureAllowed", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "removeFromFeatureFlagAllowlist", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setDeniers", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "address[]", + "name": "deniers" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setFeatureFlagAllowAll", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "bool", + "name": "allowAll" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setFeatureFlagDenyAll", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "bool", + "name": "denyAll" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "AccountHasOpenPositions", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ] + }, + { + "type": "error", + "name": "InvalidDistributor", + "inputs": [ + { + "type": "uint128", + "name": "id" + }, + { + "type": "address", + "name": "distributor" + } + ] + }, + { + "type": "error", + "name": "NotEligibleForLiquidation", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ] + }, + { + "type": "error", + "name": "NotEligibleForMarginLiquidation", + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "AccountFlaggedForLiquidation", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "int256", + "name": "availableMargin", + "indexed": false + }, + { + "type": "uint256", + "name": "requiredMaintenanceMargin", + "indexed": false + }, + { + "type": "uint256", + "name": "liquidationReward", + "indexed": false + }, + { + "type": "uint256", + "name": "flagReward", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "AccountLiquidationAttempt", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint256", + "name": "reward", + "indexed": false + }, + { + "type": "bool", + "name": "fullLiquidation", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "AccountMarginLiquidation", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint256", + "name": "seizedMarginValue", + "indexed": false + }, + { + "type": "uint256", + "name": "liquidationReward", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PositionLiquidated", + "inputs": [ + { + "type": "uint128", + "name": "accountId", + "indexed": true + }, + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint256", + "name": "amountLiquidated", + "indexed": false + }, + { + "type": "int128", + "name": "currentPositionSize", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "canLiquidate", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "bool", + "name": "isEligible" + } + ] + }, + { + "type": "function", + "name": "canLiquidateMarginOnly", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "bool", + "name": "isEligible" + } + ] + }, + { + "type": "function", + "name": "flaggedAccounts", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256[]", + "name": "accountIds" + } + ] + }, + { + "type": "function", + "name": "liquidate", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "liquidationReward" + } + ] + }, + { + "type": "function", + "name": "liquidateFlagged", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "maxNumberOfAccounts" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "liquidationReward" + } + ] + }, + { + "type": "function", + "name": "liquidateFlaggedAccounts", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128[]", + "name": "accountIds" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "liquidationReward" + } + ] + }, + { + "type": "function", + "name": "liquidateMarginOnly", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "accountId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "liquidationReward" + } + ] + }, + { + "type": "function", + "name": "liquidationCapacity", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "capacity" + }, + { + "type": "uint256", + "name": "maxLiquidationInWindow" + }, + { + "type": "uint256", + "name": "latestLiquidationTimestamp" + } + ] + }, + { + "type": "error", + "name": "InvalidSettlementWindowDuration", + "inputs": [ + { + "type": "uint256", + "name": "duration" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FundingParametersSet", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint256", + "name": "skewScale", + "indexed": false + }, + { + "type": "uint256", + "name": "maxFundingVelocity", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "LiquidationParametersSet", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint256", + "name": "initialMarginRatioD18", + "indexed": false + }, + { + "type": "uint256", + "name": "maintenanceMarginRatioD18", + "indexed": false + }, + { + "type": "uint256", + "name": "minimumInitialMarginRatioD18", + "indexed": false + }, + { + "type": "uint256", + "name": "flagRewardRatioD18", + "indexed": false + }, + { + "type": "uint256", + "name": "minimumPositionMargin", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "LockedOiRatioSet", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint256", + "name": "lockedOiRatioD18", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketPriceDataUpdated", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "bytes32", + "name": "feedId", + "indexed": false + }, + { + "type": "uint256", + "name": "strictStalenessTolerance", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MaxLiquidationParametersSet", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint256", + "name": "maxLiquidationLimitAccumulationMultiplier", + "indexed": false + }, + { + "type": "uint256", + "name": "maxSecondsInLiquidationWindow", + "indexed": false + }, + { + "type": "uint256", + "name": "maxLiquidationPd", + "indexed": false + }, + { + "type": "address", + "name": "endorsedLiquidator", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MaxMarketSizeSet", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint256", + "name": "maxMarketSize", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MaxMarketValueSet", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint256", + "name": "maxMarketValue", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "OrderFeesSet", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint256", + "name": "makerFeeRatio", + "indexed": false + }, + { + "type": "uint256", + "name": "takerFeeRatio", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SettlementStrategyAdded", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "tuple", + "name": "strategy", + "indexed": false, + "components": [ + { + "type": "uint8", + "name": "strategyType" + }, + { + "type": "uint256", + "name": "settlementDelay" + }, + { + "type": "uint256", + "name": "settlementWindowDuration" + }, + { + "type": "address", + "name": "priceVerificationContract" + }, + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "uint256", + "name": "settlementReward" + }, + { + "type": "bool", + "name": "disabled" + }, + { + "type": "uint256", + "name": "commitmentPriceDelay" + } + ] + }, + { + "type": "uint256", + "name": "strategyId", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SettlementStrategySet", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint256", + "name": "strategyId", + "indexed": true + }, + { + "type": "tuple", + "name": "strategy", + "indexed": false, + "components": [ + { + "type": "uint8", + "name": "strategyType" + }, + { + "type": "uint256", + "name": "settlementDelay" + }, + { + "type": "uint256", + "name": "settlementWindowDuration" + }, + { + "type": "address", + "name": "priceVerificationContract" + }, + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "uint256", + "name": "settlementReward" + }, + { + "type": "bool", + "name": "disabled" + }, + { + "type": "uint256", + "name": "commitmentPriceDelay" + } + ] + } + ] + }, + { + "type": "function", + "name": "addSettlementStrategy", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "tuple", + "name": "strategy", + "components": [ + { + "type": "uint8", + "name": "strategyType" + }, + { + "type": "uint256", + "name": "settlementDelay" + }, + { + "type": "uint256", + "name": "settlementWindowDuration" + }, + { + "type": "address", + "name": "priceVerificationContract" + }, + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "uint256", + "name": "settlementReward" + }, + { + "type": "bool", + "name": "disabled" + }, + { + "type": "uint256", + "name": "commitmentPriceDelay" + } + ] + } + ], + "outputs": [ + { + "type": "uint256", + "name": "strategyId" + } + ] + }, + { + "type": "function", + "name": "getFundingParameters", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "skewScale" + }, + { + "type": "uint256", + "name": "maxFundingVelocity" + } + ] + }, + { + "type": "function", + "name": "getLiquidationParameters", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "initialMarginRatioD18" + }, + { + "type": "uint256", + "name": "minimumInitialMarginRatioD18" + }, + { + "type": "uint256", + "name": "maintenanceMarginScalarD18" + }, + { + "type": "uint256", + "name": "flagRewardRatioD18" + }, + { + "type": "uint256", + "name": "minimumPositionMargin" + } + ] + }, + { + "type": "function", + "name": "getLockedOiRatio", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getMaxLiquidationParameters", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "maxLiquidationLimitAccumulationMultiplier" + }, + { + "type": "uint256", + "name": "maxSecondsInLiquidationWindow" + }, + { + "type": "uint256", + "name": "maxLiquidationPd" + }, + { + "type": "address", + "name": "endorsedLiquidator" + } + ] + }, + { + "type": "function", + "name": "getMaxMarketSize", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "maxMarketSize" + } + ] + }, + { + "type": "function", + "name": "getMaxMarketValue", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "maxMarketValue" + } + ] + }, + { + "type": "function", + "name": "getOrderFees", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "makerFee" + }, + { + "type": "uint256", + "name": "takerFee" + } + ] + }, + { + "type": "function", + "name": "getPriceData", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "perpsMarketId" + } + ], + "outputs": [ + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "uint256", + "name": "strictStalenessTolerance" + } + ] + }, + { + "type": "function", + "name": "getSettlementStrategy", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "strategyId" + } + ], + "outputs": [ + { + "type": "tuple", + "name": "settlementStrategy", + "components": [ + { + "type": "uint8", + "name": "strategyType" + }, + { + "type": "uint256", + "name": "settlementDelay" + }, + { + "type": "uint256", + "name": "settlementWindowDuration" + }, + { + "type": "address", + "name": "priceVerificationContract" + }, + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "uint256", + "name": "settlementReward" + }, + { + "type": "bool", + "name": "disabled" + }, + { + "type": "uint256", + "name": "commitmentPriceDelay" + } + ] + } + ] + }, + { + "type": "function", + "name": "setFundingParameters", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "skewScale" + }, + { + "type": "uint256", + "name": "maxFundingVelocity" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setLiquidationParameters", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "initialMarginRatioD18" + }, + { + "type": "uint256", + "name": "minimumInitialMarginRatioD18" + }, + { + "type": "uint256", + "name": "maintenanceMarginScalarD18" + }, + { + "type": "uint256", + "name": "flagRewardRatioD18" + }, + { + "type": "uint256", + "name": "minimumPositionMargin" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setLockedOiRatio", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "lockedOiRatioD18" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setMaxLiquidationParameters", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "maxLiquidationLimitAccumulationMultiplier" + }, + { + "type": "uint256", + "name": "maxSecondsInLiquidationWindow" + }, + { + "type": "uint256", + "name": "maxLiquidationPd" + }, + { + "type": "address", + "name": "endorsedLiquidator" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setMaxMarketSize", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "maxMarketSize" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setMaxMarketValue", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "maxMarketValue" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setOrderFees", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "makerFeeRatio" + }, + { + "type": "uint256", + "name": "takerFeeRatio" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setSettlementStrategy", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "strategyId" + }, + { + "type": "tuple", + "name": "strategy", + "components": [ + { + "type": "uint8", + "name": "strategyType" + }, + { + "type": "uint256", + "name": "settlementDelay" + }, + { + "type": "uint256", + "name": "settlementWindowDuration" + }, + { + "type": "address", + "name": "priceVerificationContract" + }, + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "uint256", + "name": "settlementReward" + }, + { + "type": "bool", + "name": "disabled" + }, + { + "type": "uint256", + "name": "commitmentPriceDelay" + } + ] + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setSettlementStrategyEnabled", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "strategyId" + }, + { + "type": "bool", + "name": "enabled" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "updatePriceData", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "perpsMarketId" + }, + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "uint256", + "name": "strictStalenessTolerance" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "InvalidDistributorContract", + "inputs": [ + { + "type": "address", + "name": "distributor" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "CollateralConfigurationSet", + "inputs": [ + { + "type": "uint128", + "name": "collateralId", + "indexed": true + }, + { + "type": "uint256", + "name": "maxCollateralAmount", + "indexed": false + }, + { + "type": "uint256", + "name": "upperLimitDiscount", + "indexed": false + }, + { + "type": "uint256", + "name": "lowerLimitDiscount", + "indexed": false + }, + { + "type": "uint256", + "name": "discountScalar", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "CollateralLiquidateRewardRatioSet", + "inputs": [ + { + "type": "uint128", + "name": "collateralLiquidateRewardRatioD18", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RewardDistributorRegistered", + "inputs": [ + { + "type": "address", + "name": "distributor", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "getCollateralConfiguration", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "collateralId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "maxCollateralAmount" + } + ] + }, + { + "type": "function", + "name": "getCollateralConfigurationFull", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "collateralId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "maxCollateralAmount" + }, + { + "type": "uint256", + "name": "upperLimitDiscount" + }, + { + "type": "uint256", + "name": "lowerLimitDiscount" + }, + { + "type": "uint256", + "name": "discountScalar" + } + ] + }, + { + "type": "function", + "name": "getCollateralLiquidateRewardRatio", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint128", + "name": "collateralLiquidateRewardRatioD18" + } + ] + }, + { + "type": "function", + "name": "getRegisteredDistributor", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "collateralId" + } + ], + "outputs": [ + { + "type": "address", + "name": "distributor" + }, + { + "type": "address[]", + "name": "poolDelegatedCollateralTypes" + } + ] + }, + { + "type": "function", + "name": "isRegistered", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "distributor" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "registerDistributor", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "token" + }, + { + "type": "address", + "name": "distributor" + }, + { + "type": "uint128", + "name": "collateralId" + }, + { + "type": "address[]", + "name": "poolDelegatedCollateralTypes" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setCollateralConfiguration", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "collateralId" + }, + { + "type": "uint256", + "name": "maxCollateralAmount" + }, + { + "type": "uint256", + "name": "upperLimitDiscount" + }, + { + "type": "uint256", + "name": "lowerLimitDiscount" + }, + { + "type": "uint256", + "name": "discountScalar" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setCollateralLiquidateRewardRatio", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "collateralLiquidateRewardRatioD18" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "InvalidFeeCollectorInterface", + "inputs": [ + { + "type": "address", + "name": "invalidFeeCollector" + } + ] + }, + { + "type": "error", + "name": "InvalidInterestRateParameters", + "inputs": [ + { + "type": "uint128", + "name": "lowUtilizationInterestRateGradient" + }, + { + "type": "uint128", + "name": "highUtilizationInterestRateGradient" + } + ] + }, + { + "type": "error", + "name": "InvalidReferrerShareRatio", + "inputs": [ + { + "type": "uint256", + "name": "shareRatioD18" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeeCollectorSet", + "inputs": [ + { + "type": "address", + "name": "feeCollector", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "InterestRateParametersSet", + "inputs": [ + { + "type": "uint256", + "name": "lowUtilizationInterestRateGradient", + "indexed": false + }, + { + "type": "uint256", + "name": "interestRateGradientBreakpoint", + "indexed": false + }, + { + "type": "uint256", + "name": "highUtilizationInterestRateGradient", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "KeeperCostNodeIdUpdated", + "inputs": [ + { + "type": "bytes32", + "name": "keeperCostNodeId", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "KeeperRewardGuardsSet", + "inputs": [ + { + "type": "uint256", + "name": "minKeeperRewardUsd", + "indexed": false + }, + { + "type": "uint256", + "name": "minKeeperProfitRatioD18", + "indexed": false + }, + { + "type": "uint256", + "name": "maxKeeperRewardUsd", + "indexed": false + }, + { + "type": "uint256", + "name": "maxKeeperScalingRatioD18", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "PerAccountCapsSet", + "inputs": [ + { + "type": "uint128", + "name": "maxPositionsPerAccount", + "indexed": false + }, + { + "type": "uint128", + "name": "maxCollateralsPerAccount", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "ReferrerShareUpdated", + "inputs": [ + { + "type": "address", + "name": "referrer", + "indexed": false + }, + { + "type": "uint256", + "name": "shareRatioD18", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "getFeeCollector", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "feeCollector" + } + ] + }, + { + "type": "function", + "name": "getInterestRateParameters", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint128", + "name": "lowUtilizationInterestRateGradient" + }, + { + "type": "uint128", + "name": "interestRateGradientBreakpoint" + }, + { + "type": "uint128", + "name": "highUtilizationInterestRateGradient" + } + ] + }, + { + "type": "function", + "name": "getKeeperCostNodeId", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "keeperCostNodeId" + } + ] + }, + { + "type": "function", + "name": "getKeeperRewardGuards", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "minKeeperRewardUsd" + }, + { + "type": "uint256", + "name": "minKeeperProfitRatioD18" + }, + { + "type": "uint256", + "name": "maxKeeperRewardUsd" + }, + { + "type": "uint256", + "name": "maxKeeperScalingRatioD18" + } + ] + }, + { + "type": "function", + "name": "getMarkets", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256[]", + "name": "marketIds" + } + ] + }, + { + "type": "function", + "name": "getPerAccountCaps", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint128", + "name": "maxPositionsPerAccount" + }, + { + "type": "uint128", + "name": "maxCollateralsPerAccount" + } + ] + }, + { + "type": "function", + "name": "getReferrerShare", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "referrer" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "shareRatioD18" + } + ] + }, + { + "type": "function", + "name": "getSupportedCollaterals", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256[]", + "name": "supportedCollaterals" + } + ] + }, + { + "type": "function", + "name": "globalCollateralValue", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "collateralId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "collateralValue" + } + ] + }, + { + "type": "function", + "name": "setFeeCollector", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "feeCollector" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setInterestRateParameters", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "lowUtilizationInterestRateGradient" + }, + { + "type": "uint128", + "name": "interestRateGradientBreakpoint" + }, + { + "type": "uint128", + "name": "highUtilizationInterestRateGradient" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setKeeperRewardGuards", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "minKeeperRewardUsd" + }, + { + "type": "uint256", + "name": "minKeeperProfitRatioD18" + }, + { + "type": "uint256", + "name": "maxKeeperRewardUsd" + }, + { + "type": "uint256", + "name": "maxKeeperScalingRatioD18" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setPerAccountCaps", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "maxPositionsPerAccount" + }, + { + "type": "uint128", + "name": "maxCollateralsPerAccount" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "totalGlobalCollateralValue", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "totalCollateralValue" + } + ] + }, + { + "type": "function", + "name": "updateInterestRate", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "updateKeeperCostNodeId", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "keeperCostNodeId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "updateReferrerShare", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "referrer" + }, + { + "type": "uint256", + "name": "shareRatioD18" + } + ], + "outputs": [] + } +] diff --git a/indexers/arbitrum-sepolia/src/abi/PerpsMarketProxy.ts b/indexers/arbitrum-sepolia/src/abi/PerpsMarketProxy.ts new file mode 100644 index 00000000..cd5bc5d4 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/abi/PerpsMarketProxy.ts @@ -0,0 +1,836 @@ +import * as ethers from 'ethers' +import {LogEvent, Func, ContractBase} from './abi.support' +import {ABI_JSON} from './PerpsMarketProxy.abi' + +export const abi = new ethers.Interface(ABI_JSON); + +export const events = { + AccountCreated: new LogEvent<([accountId: bigint, owner: string] & {accountId: bigint, owner: string})>( + abi, '0xa9e04d307e860938fa63307df8b8090e365276e59fcca12ed55656c25e538019' + ), + PermissionGranted: new LogEvent<([accountId: bigint, permission: string, user: string, sender: string] & {accountId: bigint, permission: string, user: string, sender: string})>( + abi, '0x32ff7c3f84299a3543c1e89057e98ba962f4fbe7786c52289e184c57b9a36a50' + ), + PermissionRevoked: new LogEvent<([accountId: bigint, permission: string, user: string, sender: string] & {accountId: bigint, permission: string, user: string, sender: string})>( + abi, '0x116c7e9cd2db316974fb473babcbcd625be1350842d0319e761d30aefb09a58a' + ), + AssociatedSystemSet: new LogEvent<([kind: string, id: string, proxy: string, impl: string] & {kind: string, id: string, proxy: string, impl: string})>( + abi, '0xc8551a5a03a7b06d5d20159b3b8839429a7aefab4bf3d020f1b65fa903ccb3d2' + ), + OwnerChanged: new LogEvent<([oldOwner: string, newOwner: string] & {oldOwner: string, newOwner: string})>( + abi, '0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c' + ), + OwnerNominated: new LogEvent<([newOwner: string] & {newOwner: string})>( + abi, '0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22' + ), + Upgraded: new LogEvent<([self: string, implementation: string] & {self: string, implementation: string})>( + abi, '0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7' + ), + FactoryInitialized: new LogEvent<([globalPerpsMarketId: bigint] & {globalPerpsMarketId: bigint})>( + abi, '0xb3240229b07e26f2f02e69dda85ede86e162ccbc6d10e6aade28931e7f533339' + ), + MarketCreated: new LogEvent<([perpsMarketId: bigint, marketName: string, marketSymbol: string] & {perpsMarketId: bigint, marketName: string, marketSymbol: string})>( + abi, '0x032553f94ac1323933f22650ec5b8e232babf1c47efca69383b749463116cc49' + ), + CollateralModified: new LogEvent<([accountId: bigint, collateralId: bigint, amountDelta: bigint, sender: string] & {accountId: bigint, collateralId: bigint, amountDelta: bigint, sender: string})>( + abi, '0x2e8360c2f3a6fc1a15aefdd0a0922bea3c898cb90d38c3a97354e7c013116064' + ), + DebtPaid: new LogEvent<([accountId: bigint, amount: bigint, sender: string] & {accountId: bigint, amount: bigint, sender: string})>( + abi, '0x4b2a60a1cb0c1127885a9f73b6ffca09ebb4cf25eba65024ee660b9b7008e823' + ), + InterestRateUpdated: new LogEvent<([superMarketId: bigint, interestRate: bigint] & {superMarketId: bigint, interestRate: bigint})>( + abi, '0x13cc429774e87628617cfcb0a54da0a45b9deddfe73719fe97c353e77fc13025' + ), + OrderCommitted: new LogEvent<([marketId: bigint, accountId: bigint, orderType: number, sizeDelta: bigint, acceptablePrice: bigint, commitmentTime: bigint, expectedPriceTime: bigint, settlementTime: bigint, expirationTime: bigint, trackingCode: string, sender: string] & {marketId: bigint, accountId: bigint, orderType: number, sizeDelta: bigint, acceptablePrice: bigint, commitmentTime: bigint, expectedPriceTime: bigint, settlementTime: bigint, expirationTime: bigint, trackingCode: string, sender: string})>( + abi, '0xeb7f3a2236186f1b0e183dad9959f6ece678f3d80447b125224e23942f50d44f' + ), + PreviousOrderExpired: new LogEvent<([marketId: bigint, accountId: bigint, sizeDelta: bigint, acceptablePrice: bigint, commitmentTime: bigint, trackingCode: string] & {marketId: bigint, accountId: bigint, sizeDelta: bigint, acceptablePrice: bigint, commitmentTime: bigint, trackingCode: string})>( + abi, '0x6d83c6751813f50325d75bc054621f83299659c5814d1e5fe6ac117860710dde' + ), + AccountCharged: new LogEvent<([accountId: bigint, amount: bigint, accountDebt: bigint] & {accountId: bigint, amount: bigint, accountDebt: bigint})>( + abi, '0x0f0c4533e494a73710ef5720710448c8206681251f728460d5753f86c12004f7' + ), + InterestCharged: new LogEvent<([accountId: bigint, interest: bigint] & {accountId: bigint, interest: bigint})>( + abi, '0xaf1bec63dc46ef212d5d5da0c9e303b8eb4394789d879ff849347302a390ae5c' + ), + MarketUpdated: new LogEvent<([marketId: bigint, price: bigint, skew: bigint, size: bigint, sizeDelta: bigint, currentFundingRate: bigint, currentFundingVelocity: bigint, interestRate: bigint] & {marketId: bigint, price: bigint, skew: bigint, size: bigint, sizeDelta: bigint, currentFundingRate: bigint, currentFundingVelocity: bigint, interestRate: bigint})>( + abi, '0x346c68f39d865d9102f8e506228e49f3ff189d487acd496f59cfff5163dd7d70' + ), + OrderSettled: new LogEvent<([marketId: bigint, accountId: bigint, fillPrice: bigint, pnl: bigint, accruedFunding: bigint, sizeDelta: bigint, newSize: bigint, totalFees: bigint, referralFees: bigint, collectedFees: bigint, settlementReward: bigint, trackingCode: string, settler: string] & {marketId: bigint, accountId: bigint, fillPrice: bigint, pnl: bigint, accruedFunding: bigint, sizeDelta: bigint, newSize: bigint, totalFees: bigint, referralFees: bigint, collectedFees: bigint, settlementReward: bigint, trackingCode: string, settler: string})>( + abi, '0x460080a757ec90719fe90ab2384c0196cdeed071a9fd7ce1ada43481d96b7db5' + ), + OrderCancelled: new LogEvent<([marketId: bigint, accountId: bigint, desiredPrice: bigint, fillPrice: bigint, sizeDelta: bigint, settlementReward: bigint, trackingCode: string, settler: string] & {marketId: bigint, accountId: bigint, desiredPrice: bigint, fillPrice: bigint, sizeDelta: bigint, settlementReward: bigint, trackingCode: string, settler: string})>( + abi, '0x7415070016cafa6a064ae5b74d75f9968c033ce38621b3dc6d8e7a3b1e64e3ed' + ), + FeatureFlagAllowAllSet: new LogEvent<([feature: string, allowAll: boolean] & {feature: string, allowAll: boolean})>( + abi, '0xa806035d8c8de7cd43725250d3fbf9ee7abe3b99ffb892897913d8a21721121d' + ), + FeatureFlagAllowlistAdded: new LogEvent<([feature: string, account: string] & {feature: string, account: string})>( + abi, '0x30b9b4104e2fb00b4f980e414dcd828e691c8fcb286f0c73d7267c3a2de49383' + ), + FeatureFlagAllowlistRemoved: new LogEvent<([feature: string, account: string] & {feature: string, account: string})>( + abi, '0xb44a47e11880cc865e8ea382561e406dea8c895366c58e3908f05708b2880890' + ), + FeatureFlagDeniersReset: new LogEvent<([feature: string, deniers: Array] & {feature: string, deniers: Array})>( + abi, '0x74d48d0b51a70680130c00decd06b4d536fbb3cee16a3b0bdd2309c264dcbd13' + ), + FeatureFlagDenyAllSet: new LogEvent<([feature: string, denyAll: boolean] & {feature: string, denyAll: boolean})>( + abi, '0x97f76d2e384948e28ddd4280a4e76e8600acc328a0c0910c93682a0fccc02018' + ), + AccountFlaggedForLiquidation: new LogEvent<([accountId: bigint, availableMargin: bigint, requiredMaintenanceMargin: bigint, liquidationReward: bigint, flagReward: bigint] & {accountId: bigint, availableMargin: bigint, requiredMaintenanceMargin: bigint, liquidationReward: bigint, flagReward: bigint})>( + abi, '0xee38d74835b41491aaf94362bbbd5c0a844c795e5c2de530ddf37c91b0179ba9' + ), + AccountLiquidationAttempt: new LogEvent<([accountId: bigint, reward: bigint, fullLiquidation: boolean] & {accountId: bigint, reward: bigint, fullLiquidation: boolean})>( + abi, '0x26ef135389b1c68384b54bcb8b8c6b329a4cc302ab22474b8991fa4e957def35' + ), + AccountMarginLiquidation: new LogEvent<([accountId: bigint, seizedMarginValue: bigint, liquidationReward: bigint] & {accountId: bigint, seizedMarginValue: bigint, liquidationReward: bigint})>( + abi, '0x8d4cc65a0877c8660be72088e9e710822c801026a6ba5cb13792248b852c9113' + ), + PositionLiquidated: new LogEvent<([accountId: bigint, marketId: bigint, amountLiquidated: bigint, currentPositionSize: bigint] & {accountId: bigint, marketId: bigint, amountLiquidated: bigint, currentPositionSize: bigint})>( + abi, '0xd583c0e2965aae317f4a9a6603c0c75602b9bc97dc7c5fc6446b0ba8d3ff1bb2' + ), + FundingParametersSet: new LogEvent<([marketId: bigint, skewScale: bigint, maxFundingVelocity: bigint] & {marketId: bigint, skewScale: bigint, maxFundingVelocity: bigint})>( + abi, '0xa74afd926bbafbb9252d224a1fcd6a209f851324bd485f556786820a76e31b65' + ), + LiquidationParametersSet: new LogEvent<([marketId: bigint, initialMarginRatioD18: bigint, maintenanceMarginRatioD18: bigint, minimumInitialMarginRatioD18: bigint, flagRewardRatioD18: bigint, minimumPositionMargin: bigint] & {marketId: bigint, initialMarginRatioD18: bigint, maintenanceMarginRatioD18: bigint, minimumInitialMarginRatioD18: bigint, flagRewardRatioD18: bigint, minimumPositionMargin: bigint})>( + abi, '0xa0c87f048ec4f5924e50d554aa4a6e65a935f133a2114e5222590c1690e1a7b8' + ), + LockedOiRatioSet: new LogEvent<([marketId: bigint, lockedOiRatioD18: bigint] & {marketId: bigint, lockedOiRatioD18: bigint})>( + abi, '0x1d841fd5b4c806bc5a073d637a8506e1e74d16cb18251b711cb47e133ceafc2d' + ), + MarketPriceDataUpdated: new LogEvent<([marketId: bigint, feedId: string, strictStalenessTolerance: bigint] & {marketId: bigint, feedId: string, strictStalenessTolerance: bigint})>( + abi, '0x6cf30df68198cadbabcf0342baee973e970617ec00e3cd564a8dc130b0d82dac' + ), + MaxLiquidationParametersSet: new LogEvent<([marketId: bigint, maxLiquidationLimitAccumulationMultiplier: bigint, maxSecondsInLiquidationWindow: bigint, maxLiquidationPd: bigint, endorsedLiquidator: string] & {marketId: bigint, maxLiquidationLimitAccumulationMultiplier: bigint, maxSecondsInLiquidationWindow: bigint, maxLiquidationPd: bigint, endorsedLiquidator: string})>( + abi, '0x9012ce377b7043d153d2cba3376efe7e1742af5acb7e38897362f392a7dc89ed' + ), + MaxMarketSizeSet: new LogEvent<([marketId: bigint, maxMarketSize: bigint] & {marketId: bigint, maxMarketSize: bigint})>( + abi, '0xbd063bd3072a194b255163ab8dfd3400c4ab1cc641b920e7aaf1c11f92cd26cf' + ), + MaxMarketValueSet: new LogEvent<([marketId: bigint, maxMarketValue: bigint] & {marketId: bigint, maxMarketValue: bigint})>( + abi, '0x899b5a42ab35d659b6afef45eee0eaeef7fa0d3290dd18af9b1f97b31952a300' + ), + OrderFeesSet: new LogEvent<([marketId: bigint, makerFeeRatio: bigint, takerFeeRatio: bigint] & {marketId: bigint, makerFeeRatio: bigint, takerFeeRatio: bigint})>( + abi, '0x28969f156340ba9eb31589904eb174d3a4b6a37781fa6f7ad289d349d75dd1ee' + ), + SettlementStrategyAdded: new LogEvent<([marketId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint}), strategyId: bigint] & {marketId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint}), strategyId: bigint})>( + abi, '0x254a9d9f59b5ec6894fda88373cbd55c8cce1734b744f3d3edfec275d84ada56' + ), + SettlementStrategySet: new LogEvent<([marketId: bigint, strategyId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint})] & {marketId: bigint, strategyId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint})})>( + abi, '0xdc5a4c4a722e4423d35b4fdcc236de75a4766a2625ae2f19411bfeeb3c160bf1' + ), + CollateralConfigurationSet: new LogEvent<([collateralId: bigint, maxCollateralAmount: bigint, upperLimitDiscount: bigint, lowerLimitDiscount: bigint, discountScalar: bigint] & {collateralId: bigint, maxCollateralAmount: bigint, upperLimitDiscount: bigint, lowerLimitDiscount: bigint, discountScalar: bigint})>( + abi, '0x304ed8aa0efc4ca9f7fbcb32db12457495001ace596100f50777f05d203316f2' + ), + CollateralLiquidateRewardRatioSet: new LogEvent<([collateralLiquidateRewardRatioD18: bigint] & {collateralLiquidateRewardRatioD18: bigint})>( + abi, '0x43c42438f2f0aa5d7cc5e4d40fd9bc53a2ed99e225941715396740d6a74c7f78' + ), + RewardDistributorRegistered: new LogEvent<([distributor: string] & {distributor: string})>( + abi, '0x74adf812baf946d305ba8724699e32e055bf8664faac58fe27fade6a1a29c400' + ), + FeeCollectorSet: new LogEvent<([feeCollector: string] & {feeCollector: string})>( + abi, '0x12e1d17016b94668449f97876f4a8d5cc2c19f314db337418894734037cc19d4' + ), + InterestRateParametersSet: new LogEvent<([lowUtilizationInterestRateGradient: bigint, interestRateGradientBreakpoint: bigint, highUtilizationInterestRateGradient: bigint] & {lowUtilizationInterestRateGradient: bigint, interestRateGradientBreakpoint: bigint, highUtilizationInterestRateGradient: bigint})>( + abi, '0x9ab1d43881e1e730680d49d0c0f0da5fa8f38afa0fa2f9cf88674531c6212ef5' + ), + KeeperCostNodeIdUpdated: new LogEvent<([keeperCostNodeId: string] & {keeperCostNodeId: string})>( + abi, '0x60cb06323d52fe6ab34750c42db77ba8dd1e013bb393edb9e1c88a88dee500a7' + ), + KeeperRewardGuardsSet: new LogEvent<([minKeeperRewardUsd: bigint, minKeeperProfitRatioD18: bigint, maxKeeperRewardUsd: bigint, maxKeeperScalingRatioD18: bigint] & {minKeeperRewardUsd: bigint, minKeeperProfitRatioD18: bigint, maxKeeperRewardUsd: bigint, maxKeeperScalingRatioD18: bigint})>( + abi, '0xdc784d5448d4b3c13f36956adb978d1e276f2e0c8d37e78c262b5be7641d8b54' + ), + PerAccountCapsSet: new LogEvent<([maxPositionsPerAccount: bigint, maxCollateralsPerAccount: bigint] & {maxPositionsPerAccount: bigint, maxCollateralsPerAccount: bigint})>( + abi, '0x3448c6d1990f2d48253b91394193cd11ce49f1653f2d03934af6d17195ffe34e' + ), + ReferrerShareUpdated: new LogEvent<([referrer: string, shareRatioD18: bigint] & {referrer: string, shareRatioD18: bigint})>( + abi, '0xa225c555f4cd21a533ad4e01eaf30153c84ca28265d954a651410d3c1e56242c' + ), +} + +export const functions = { + 'createAccount()': new Func<[], {}, bigint>( + abi, '0x9dca362f' + ), + 'createAccount(uint128)': new Func<[requestedAccountId: bigint], {requestedAccountId: bigint}, []>( + abi, '0xcadb09a5' + ), + getAccountLastInteraction: new Func<[accountId: bigint], {accountId: bigint}, bigint>( + abi, '0x1b5dccdb' + ), + getAccountOwner: new Func<[accountId: bigint], {accountId: bigint}, string>( + abi, '0xbf60c31d' + ), + getAccountPermissions: new Func<[accountId: bigint], {accountId: bigint}, Array<([user: string, permissions: Array] & {user: string, permissions: Array})>>( + abi, '0xa796fecd' + ), + getAccountTokenAddress: new Func<[], {}, string>( + abi, '0xa148bf10' + ), + grantPermission: new Func<[accountId: bigint, permission: string, user: string], {accountId: bigint, permission: string, user: string}, []>( + abi, '0x00cd9ef3' + ), + hasPermission: new Func<[accountId: bigint, permission: string, user: string], {accountId: bigint, permission: string, user: string}, boolean>( + abi, '0x8d34166b' + ), + isAuthorized: new Func<[accountId: bigint, permission: string, user: string], {accountId: bigint, permission: string, user: string}, boolean>( + abi, '0x1213d453' + ), + notifyAccountTransfer: new Func<[to: string, accountId: bigint], {to: string, accountId: bigint}, []>( + abi, '0x7dec8b55' + ), + renouncePermission: new Func<[accountId: bigint, permission: string], {accountId: bigint, permission: string}, []>( + abi, '0x47c1c561' + ), + revokePermission: new Func<[accountId: bigint, permission: string, user: string], {accountId: bigint, permission: string, user: string}, []>( + abi, '0xa7627288' + ), + getAssociatedSystem: new Func<[id: string], {id: string}, ([addr: string, kind: string] & {addr: string, kind: string})>( + abi, '0x60988e09' + ), + initOrUpgradeNft: new Func<[id: string, name: string, symbol: string, uri: string, impl: string], {id: string, name: string, symbol: string, uri: string, impl: string}, []>( + abi, '0x2d22bef9' + ), + initOrUpgradeToken: new Func<[id: string, name: string, symbol: string, decimals: number, impl: string], {id: string, name: string, symbol: string, decimals: number, impl: string}, []>( + abi, '0xc6f79537' + ), + registerUnmanagedSystem: new Func<[id: string, endpoint: string], {id: string, endpoint: string}, []>( + abi, '0xd245d983' + ), + acceptOwnership: new Func<[], {}, []>( + abi, '0x79ba5097' + ), + getImplementation: new Func<[], {}, string>( + abi, '0xaaf10f42' + ), + nominateNewOwner: new Func<[newNominatedOwner: string], {newNominatedOwner: string}, []>( + abi, '0x1627540c' + ), + nominatedOwner: new Func<[], {}, string>( + abi, '0x53a47bb7' + ), + owner: new Func<[], {}, string>( + abi, '0x8da5cb5b' + ), + renounceNomination: new Func<[], {}, []>( + abi, '0x718fe928' + ), + simulateUpgradeTo: new Func<[newImplementation: string], {newImplementation: string}, []>( + abi, '0xc7f62cda' + ), + upgradeTo: new Func<[newImplementation: string], {newImplementation: string}, []>( + abi, '0x3659cfe6' + ), + createMarket: new Func<[requestedMarketId: bigint, marketName: string, marketSymbol: string], {requestedMarketId: bigint, marketName: string, marketSymbol: string}, bigint>( + abi, '0x7e947ea4' + ), + initializeFactory: new Func<[synthetix: string, spotMarket: string], {synthetix: string, spotMarket: string}, bigint>( + abi, '0x3bef7df4' + ), + interestRate: new Func<[], {}, bigint>( + abi, '0x7c3a00fd' + ), + minimumCredit: new Func<[perpsMarketId: bigint], {perpsMarketId: bigint}, bigint>( + abi, '0xafe79200' + ), + name: new Func<[perpsMarketId: bigint], {perpsMarketId: bigint}, string>( + abi, '0xc624440a' + ), + reportedDebt: new Func<[perpsMarketId: bigint], {perpsMarketId: bigint}, bigint>( + abi, '0xbcec0d0f' + ), + setPerpsMarketName: new Func<[marketName: string], {marketName: string}, []>( + abi, '0x55576c59' + ), + supportsInterface: new Func<[interfaceId: string], {interfaceId: string}, boolean>( + abi, '0x01ffc9a7' + ), + utilizationRate: new Func<[], {}, ([rate: bigint, delegatedCollateral: bigint, lockedCredit: bigint] & {rate: bigint, delegatedCollateral: bigint, lockedCredit: bigint})>( + abi, '0x6c321c8a' + ), + debt: new Func<[accountId: bigint], {accountId: bigint}, bigint>( + abi, '0xcafdefbc' + ), + getAccountCollateralIds: new Func<[accountId: bigint], {accountId: bigint}, Array>( + abi, '0x9734ba0f' + ), + getAccountOpenPositions: new Func<[accountId: bigint], {accountId: bigint}, Array>( + abi, '0x35254238' + ), + getAvailableMargin: new Func<[accountId: bigint], {accountId: bigint}, bigint>( + abi, '0x0a7dad2d' + ), + getCollateralAmount: new Func<[accountId: bigint, collateralId: bigint], {accountId: bigint, collateralId: bigint}, bigint>( + abi, '0x5dbd5c9b' + ), + getOpenPosition: new Func<[accountId: bigint, marketId: bigint], {accountId: bigint, marketId: bigint}, ([totalPnl: bigint, accruedFunding: bigint, positionSize: bigint, owedInterest: bigint] & {totalPnl: bigint, accruedFunding: bigint, positionSize: bigint, owedInterest: bigint})>( + abi, '0x22a73967' + ), + getOpenPositionSize: new Func<[accountId: bigint, marketId: bigint], {accountId: bigint, marketId: bigint}, bigint>( + abi, '0x6fa1b1a0' + ), + getRequiredMargins: new Func<[accountId: bigint], {accountId: bigint}, ([requiredInitialMargin: bigint, requiredMaintenanceMargin: bigint, maxLiquidationReward: bigint] & {requiredInitialMargin: bigint, requiredMaintenanceMargin: bigint, maxLiquidationReward: bigint})>( + abi, '0x3c0f0753' + ), + getWithdrawableMargin: new Func<[accountId: bigint], {accountId: bigint}, bigint>( + abi, '0x04aa363e' + ), + modifyCollateral: new Func<[accountId: bigint, collateralId: bigint, amountDelta: bigint], {accountId: bigint, collateralId: bigint, amountDelta: bigint}, []>( + abi, '0xbb58672c' + ), + payDebt: new Func<[accountId: bigint, amount: bigint], {accountId: bigint, amount: bigint}, []>( + abi, '0x0706067b' + ), + totalAccountOpenInterest: new Func<[accountId: bigint], {accountId: bigint}, bigint>( + abi, '0x2daf43bc' + ), + totalCollateralValue: new Func<[accountId: bigint], {accountId: bigint}, bigint>( + abi, '0xb568ae42' + ), + currentFundingRate: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0xd435b2a2' + ), + currentFundingVelocity: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0xf265db02' + ), + fillPrice: new Func<[marketId: bigint, orderSize: bigint, price: bigint], {marketId: bigint, orderSize: bigint, price: bigint}, bigint>( + abi, '0xdeff90ef' + ), + getMarketSummary: new Func<[marketId: bigint], {marketId: bigint}, ([skew: bigint, size: bigint, maxOpenInterest: bigint, currentFundingRate: bigint, currentFundingVelocity: bigint, indexPrice: bigint] & {skew: bigint, size: bigint, maxOpenInterest: bigint, currentFundingRate: bigint, currentFundingVelocity: bigint, indexPrice: bigint})>( + abi, '0x41c2e8bd' + ), + indexPrice: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x4f778fb4' + ), + maxOpenInterest: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x0e7cace9' + ), + metadata: new Func<[marketId: bigint], {marketId: bigint}, ([name: string, symbol: string] & {name: string, symbol: string})>( + abi, '0xe3bc36bf' + ), + size: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x2b267635' + ), + skew: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x83a7db27' + ), + commitOrder: new Func<[commitment: ([marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string] & {marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string})], {commitment: ([marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string] & {marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string})}, ([retOrder: ([commitmentTime: bigint, request: ([marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string] & {marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string})] & {commitmentTime: bigint, request: ([marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string] & {marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string})}), fees: bigint] & {retOrder: ([commitmentTime: bigint, request: ([marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string] & {marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string})] & {commitmentTime: bigint, request: ([marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string] & {marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string})}), fees: bigint})>( + abi, '0x9f978860' + ), + computeOrderFees: new Func<[marketId: bigint, sizeDelta: bigint], {marketId: bigint, sizeDelta: bigint}, ([orderFees: bigint, fillPrice: bigint] & {orderFees: bigint, fillPrice: bigint})>( + abi, '0x98ef15a2' + ), + computeOrderFeesWithPrice: new Func<[marketId: bigint, sizeDelta: bigint, price: bigint], {marketId: bigint, sizeDelta: bigint, price: bigint}, ([orderFees: bigint, fillPrice: bigint] & {orderFees: bigint, fillPrice: bigint})>( + abi, '0x06e4ba89' + ), + getOrder: new Func<[accountId: bigint], {accountId: bigint}, ([commitmentTime: bigint, request: ([marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string] & {marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string})] & {commitmentTime: bigint, request: ([marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string] & {marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string})})>( + abi, '0x117d4128' + ), + getSettlementRewardCost: new Func<[marketId: bigint, settlementStrategyId: bigint], {marketId: bigint, settlementStrategyId: bigint}, bigint>( + abi, '0xecfebba2' + ), + requiredMarginForOrder: new Func<[accountId: bigint, marketId: bigint, sizeDelta: bigint], {accountId: bigint, marketId: bigint, sizeDelta: bigint}, bigint>( + abi, '0xb8830a25' + ), + requiredMarginForOrderWithPrice: new Func<[accountId: bigint, marketId: bigint, sizeDelta: bigint, price: bigint], {accountId: bigint, marketId: bigint, sizeDelta: bigint, price: bigint}, bigint>( + abi, '0x5a6a77bf' + ), + settleOrder: new Func<[accountId: bigint], {accountId: bigint}, []>( + abi, '0xf89648fb' + ), + cancelOrder: new Func<[accountId: bigint], {accountId: bigint}, []>( + abi, '0xdbc91396' + ), + addToFeatureFlagAllowlist: new Func<[feature: string, account: string], {feature: string, account: string}, []>( + abi, '0xa0778144' + ), + getDeniers: new Func<[feature: string], {feature: string}, Array>( + abi, '0xed429cf7' + ), + getFeatureFlagAllowAll: new Func<[feature: string], {feature: string}, boolean>( + abi, '0x40a399ef' + ), + getFeatureFlagAllowlist: new Func<[feature: string], {feature: string}, Array>( + abi, '0xe12c8160' + ), + getFeatureFlagDenyAll: new Func<[feature: string], {feature: string}, boolean>( + abi, '0xbcae3ea0' + ), + isFeatureAllowed: new Func<[feature: string, account: string], {feature: string, account: string}, boolean>( + abi, '0xcf635949' + ), + removeFromFeatureFlagAllowlist: new Func<[feature: string, account: string], {feature: string, account: string}, []>( + abi, '0xb7746b59' + ), + setDeniers: new Func<[feature: string, deniers: Array], {feature: string, deniers: Array}, []>( + abi, '0x715cb7d2' + ), + setFeatureFlagAllowAll: new Func<[feature: string, allowAll: boolean], {feature: string, allowAll: boolean}, []>( + abi, '0x7d632bd2' + ), + setFeatureFlagDenyAll: new Func<[feature: string, denyAll: boolean], {feature: string, denyAll: boolean}, []>( + abi, '0x5e52ad6e' + ), + canLiquidate: new Func<[accountId: bigint], {accountId: bigint}, boolean>( + abi, '0x9b922bba' + ), + canLiquidateMarginOnly: new Func<[accountId: bigint], {accountId: bigint}, boolean>( + abi, '0x065ddfaa' + ), + flaggedAccounts: new Func<[], {}, Array>( + abi, '0xa788d01f' + ), + liquidate: new Func<[accountId: bigint], {accountId: bigint}, bigint>( + abi, '0x048577de' + ), + liquidateFlagged: new Func<[maxNumberOfAccounts: bigint], {maxNumberOfAccounts: bigint}, bigint>( + abi, '0xac53c5ae' + ), + liquidateFlaggedAccounts: new Func<[accountIds: Array], {accountIds: Array}, bigint>( + abi, '0x3ce80659' + ), + liquidateMarginOnly: new Func<[accountId: bigint], {accountId: bigint}, bigint>( + abi, '0x852806dc' + ), + liquidationCapacity: new Func<[marketId: bigint], {marketId: bigint}, ([capacity: bigint, maxLiquidationInWindow: bigint, latestLiquidationTimestamp: bigint] & {capacity: bigint, maxLiquidationInWindow: bigint, latestLiquidationTimestamp: bigint})>( + abi, '0xbb36f896' + ), + addSettlementStrategy: new Func<[marketId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint})], {marketId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint})}, bigint>( + abi, '0x74d745fc' + ), + getFundingParameters: new Func<[marketId: bigint], {marketId: bigint}, ([skewScale: bigint, maxFundingVelocity: bigint] & {skewScale: bigint, maxFundingVelocity: bigint})>( + abi, '0x1b68d8fa' + ), + getLiquidationParameters: new Func<[marketId: bigint], {marketId: bigint}, ([initialMarginRatioD18: bigint, minimumInitialMarginRatioD18: bigint, maintenanceMarginScalarD18: bigint, flagRewardRatioD18: bigint, minimumPositionMargin: bigint] & {initialMarginRatioD18: bigint, minimumInitialMarginRatioD18: bigint, maintenanceMarginScalarD18: bigint, flagRewardRatioD18: bigint, minimumPositionMargin: bigint})>( + abi, '0xf94363a6' + ), + getLockedOiRatio: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x31edc046' + ), + getMaxLiquidationParameters: new Func<[marketId: bigint], {marketId: bigint}, ([maxLiquidationLimitAccumulationMultiplier: bigint, maxSecondsInLiquidationWindow: bigint, maxLiquidationPd: bigint, endorsedLiquidator: string] & {maxLiquidationLimitAccumulationMultiplier: bigint, maxSecondsInLiquidationWindow: bigint, maxLiquidationPd: bigint, endorsedLiquidator: string})>( + abi, '0x5443e33e' + ), + getMaxMarketSize: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x19a99bf5' + ), + getMaxMarketValue: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0x3b217f67' + ), + getOrderFees: new Func<[marketId: bigint], {marketId: bigint}, ([makerFee: bigint, takerFee: bigint] & {makerFee: bigint, takerFee: bigint})>( + abi, '0xaac23e8c' + ), + getPriceData: new Func<[perpsMarketId: bigint], {perpsMarketId: bigint}, ([feedId: string, strictStalenessTolerance: bigint] & {feedId: string, strictStalenessTolerance: bigint})>( + abi, '0x462b9a2d' + ), + getSettlementStrategy: new Func<[marketId: bigint, strategyId: bigint], {marketId: bigint, strategyId: bigint}, ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint})>( + abi, '0xf74c377f' + ), + setFundingParameters: new Func<[marketId: bigint, skewScale: bigint, maxFundingVelocity: bigint], {marketId: bigint, skewScale: bigint, maxFundingVelocity: bigint}, []>( + abi, '0xc2382277' + ), + setLiquidationParameters: new Func<[marketId: bigint, initialMarginRatioD18: bigint, minimumInitialMarginRatioD18: bigint, maintenanceMarginScalarD18: bigint, flagRewardRatioD18: bigint, minimumPositionMargin: bigint], {marketId: bigint, initialMarginRatioD18: bigint, minimumInitialMarginRatioD18: bigint, maintenanceMarginScalarD18: bigint, flagRewardRatioD18: bigint, minimumPositionMargin: bigint}, []>( + abi, '0x25e5409e' + ), + setLockedOiRatio: new Func<[marketId: bigint, lockedOiRatioD18: bigint], {marketId: bigint, lockedOiRatioD18: bigint}, []>( + abi, '0x033723d9' + ), + setMaxLiquidationParameters: new Func<[marketId: bigint, maxLiquidationLimitAccumulationMultiplier: bigint, maxSecondsInLiquidationWindow: bigint, maxLiquidationPd: bigint, endorsedLiquidator: string], {marketId: bigint, maxLiquidationLimitAccumulationMultiplier: bigint, maxSecondsInLiquidationWindow: bigint, maxLiquidationPd: bigint, endorsedLiquidator: string}, []>( + abi, '0xc7f8a94f' + ), + setMaxMarketSize: new Func<[marketId: bigint, maxMarketSize: bigint], {marketId: bigint, maxMarketSize: bigint}, []>( + abi, '0x404a68aa' + ), + setMaxMarketValue: new Func<[marketId: bigint, maxMarketValue: bigint], {marketId: bigint, maxMarketValue: bigint}, []>( + abi, '0xdd661eea' + ), + setOrderFees: new Func<[marketId: bigint, makerFeeRatio: bigint, takerFeeRatio: bigint], {marketId: bigint, makerFeeRatio: bigint, takerFeeRatio: bigint}, []>( + abi, '0xf842fa86' + ), + setSettlementStrategy: new Func<[marketId: bigint, strategyId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint})], {marketId: bigint, strategyId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint})}, []>( + abi, '0x26641806' + ), + setSettlementStrategyEnabled: new Func<[marketId: bigint, strategyId: bigint, enabled: boolean], {marketId: bigint, strategyId: bigint, enabled: boolean}, []>( + abi, '0x7f73a891' + ), + updatePriceData: new Func<[perpsMarketId: bigint, feedId: string, strictStalenessTolerance: bigint], {perpsMarketId: bigint, feedId: string, strictStalenessTolerance: bigint}, []>( + abi, '0xb5848488' + ), + getCollateralConfiguration: new Func<[collateralId: bigint], {collateralId: bigint}, bigint>( + abi, '0xfd51558e' + ), + getCollateralConfigurationFull: new Func<[collateralId: bigint], {collateralId: bigint}, ([maxCollateralAmount: bigint, upperLimitDiscount: bigint, lowerLimitDiscount: bigint, discountScalar: bigint] & {maxCollateralAmount: bigint, upperLimitDiscount: bigint, lowerLimitDiscount: bigint, discountScalar: bigint})>( + abi, '0x6097fcda' + ), + getCollateralLiquidateRewardRatio: new Func<[], {}, bigint>( + abi, '0x59e1f8c1' + ), + getRegisteredDistributor: new Func<[collateralId: bigint], {collateralId: bigint}, ([distributor: string, poolDelegatedCollateralTypes: Array] & {distributor: string, poolDelegatedCollateralTypes: Array})>( + abi, '0x5a55b582' + ), + isRegistered: new Func<[distributor: string], {distributor: string}, boolean>( + abi, '0xc3c5a547' + ), + registerDistributor: new Func<[token: string, distributor: string, collateralId: bigint, poolDelegatedCollateralTypes: Array], {token: string, distributor: string, collateralId: bigint, poolDelegatedCollateralTypes: Array}, []>( + abi, '0xec5dedfc' + ), + setCollateralConfiguration: new Func<[collateralId: bigint, maxCollateralAmount: bigint, upperLimitDiscount: bigint, lowerLimitDiscount: bigint, discountScalar: bigint], {collateralId: bigint, maxCollateralAmount: bigint, upperLimitDiscount: bigint, lowerLimitDiscount: bigint, discountScalar: bigint}, []>( + abi, '0x6aa08501' + ), + setCollateralLiquidateRewardRatio: new Func<[collateralLiquidateRewardRatioD18: bigint], {collateralLiquidateRewardRatioD18: bigint}, []>( + abi, '0x77bedbcc' + ), + getFeeCollector: new Func<[], {}, string>( + abi, '0x12fde4b7' + ), + getInterestRateParameters: new Func<[], {}, ([lowUtilizationInterestRateGradient: bigint, interestRateGradientBreakpoint: bigint, highUtilizationInterestRateGradient: bigint] & {lowUtilizationInterestRateGradient: bigint, interestRateGradientBreakpoint: bigint, highUtilizationInterestRateGradient: bigint})>( + abi, '0xb4ed6320' + ), + getKeeperCostNodeId: new Func<[], {}, string>( + abi, '0x1f4653bb' + ), + getKeeperRewardGuards: new Func<[], {}, ([minKeeperRewardUsd: bigint, minKeeperProfitRatioD18: bigint, maxKeeperRewardUsd: bigint, maxKeeperScalingRatioD18: bigint] & {minKeeperRewardUsd: bigint, minKeeperProfitRatioD18: bigint, maxKeeperRewardUsd: bigint, maxKeeperScalingRatioD18: bigint})>( + abi, '0x26e77e84' + ), + getMarkets: new Func<[], {}, Array>( + abi, '0xec2c9016' + ), + getPerAccountCaps: new Func<[], {}, ([maxPositionsPerAccount: bigint, maxCollateralsPerAccount: bigint] & {maxPositionsPerAccount: bigint, maxCollateralsPerAccount: bigint})>( + abi, '0x774f7b07' + ), + getReferrerShare: new Func<[referrer: string], {referrer: string}, bigint>( + abi, '0xcae77b70' + ), + getSupportedCollaterals: new Func<[], {}, Array>( + abi, '0x05db8a69' + ), + globalCollateralValue: new Func<[collateralId: bigint], {collateralId: bigint}, bigint>( + abi, '0xe53427e7' + ), + setFeeCollector: new Func<[feeCollector: string], {feeCollector: string}, []>( + abi, '0xa42dce80' + ), + setInterestRateParameters: new Func<[lowUtilizationInterestRateGradient: bigint, interestRateGradientBreakpoint: bigint, highUtilizationInterestRateGradient: bigint], {lowUtilizationInterestRateGradient: bigint, interestRateGradientBreakpoint: bigint, highUtilizationInterestRateGradient: bigint}, []>( + abi, '0xbe0cbb59' + ), + setKeeperRewardGuards: new Func<[minKeeperRewardUsd: bigint, minKeeperProfitRatioD18: bigint, maxKeeperRewardUsd: bigint, maxKeeperScalingRatioD18: bigint], {minKeeperRewardUsd: bigint, minKeeperProfitRatioD18: bigint, maxKeeperRewardUsd: bigint, maxKeeperScalingRatioD18: bigint}, []>( + abi, '0x96e9f7a0' + ), + setPerAccountCaps: new Func<[maxPositionsPerAccount: bigint, maxCollateralsPerAccount: bigint], {maxPositionsPerAccount: bigint, maxCollateralsPerAccount: bigint}, []>( + abi, '0xfa0e70a7' + ), + totalGlobalCollateralValue: new Func<[], {}, bigint>( + abi, '0x65c5a0fe' + ), + updateInterestRate: new Func<[], {}, []>( + abi, '0xce76756f' + ), + updateKeeperCostNodeId: new Func<[keeperCostNodeId: string], {keeperCostNodeId: string}, []>( + abi, '0xf5322087' + ), + updateReferrerShare: new Func<[referrer: string, shareRatioD18: bigint], {referrer: string, shareRatioD18: bigint}, []>( + abi, '0x6809fb4d' + ), +} + +export class Contract extends ContractBase { + + getAccountLastInteraction(accountId: bigint): Promise { + return this.eth_call(functions.getAccountLastInteraction, [accountId]) + } + + getAccountOwner(accountId: bigint): Promise { + return this.eth_call(functions.getAccountOwner, [accountId]) + } + + getAccountPermissions(accountId: bigint): Promise] & {user: string, permissions: Array})>> { + return this.eth_call(functions.getAccountPermissions, [accountId]) + } + + getAccountTokenAddress(): Promise { + return this.eth_call(functions.getAccountTokenAddress, []) + } + + hasPermission(accountId: bigint, permission: string, user: string): Promise { + return this.eth_call(functions.hasPermission, [accountId, permission, user]) + } + + isAuthorized(accountId: bigint, permission: string, user: string): Promise { + return this.eth_call(functions.isAuthorized, [accountId, permission, user]) + } + + getAssociatedSystem(id: string): Promise<([addr: string, kind: string] & {addr: string, kind: string})> { + return this.eth_call(functions.getAssociatedSystem, [id]) + } + + getImplementation(): Promise { + return this.eth_call(functions.getImplementation, []) + } + + nominatedOwner(): Promise { + return this.eth_call(functions.nominatedOwner, []) + } + + owner(): Promise { + return this.eth_call(functions.owner, []) + } + + interestRate(): Promise { + return this.eth_call(functions.interestRate, []) + } + + minimumCredit(perpsMarketId: bigint): Promise { + return this.eth_call(functions.minimumCredit, [perpsMarketId]) + } + + name(perpsMarketId: bigint): Promise { + return this.eth_call(functions.name, [perpsMarketId]) + } + + reportedDebt(perpsMarketId: bigint): Promise { + return this.eth_call(functions.reportedDebt, [perpsMarketId]) + } + + supportsInterface(interfaceId: string): Promise { + return this.eth_call(functions.supportsInterface, [interfaceId]) + } + + utilizationRate(): Promise<([rate: bigint, delegatedCollateral: bigint, lockedCredit: bigint] & {rate: bigint, delegatedCollateral: bigint, lockedCredit: bigint})> { + return this.eth_call(functions.utilizationRate, []) + } + + debt(accountId: bigint): Promise { + return this.eth_call(functions.debt, [accountId]) + } + + getAccountCollateralIds(accountId: bigint): Promise> { + return this.eth_call(functions.getAccountCollateralIds, [accountId]) + } + + getAccountOpenPositions(accountId: bigint): Promise> { + return this.eth_call(functions.getAccountOpenPositions, [accountId]) + } + + getAvailableMargin(accountId: bigint): Promise { + return this.eth_call(functions.getAvailableMargin, [accountId]) + } + + getCollateralAmount(accountId: bigint, collateralId: bigint): Promise { + return this.eth_call(functions.getCollateralAmount, [accountId, collateralId]) + } + + getOpenPosition(accountId: bigint, marketId: bigint): Promise<([totalPnl: bigint, accruedFunding: bigint, positionSize: bigint, owedInterest: bigint] & {totalPnl: bigint, accruedFunding: bigint, positionSize: bigint, owedInterest: bigint})> { + return this.eth_call(functions.getOpenPosition, [accountId, marketId]) + } + + getOpenPositionSize(accountId: bigint, marketId: bigint): Promise { + return this.eth_call(functions.getOpenPositionSize, [accountId, marketId]) + } + + getRequiredMargins(accountId: bigint): Promise<([requiredInitialMargin: bigint, requiredMaintenanceMargin: bigint, maxLiquidationReward: bigint] & {requiredInitialMargin: bigint, requiredMaintenanceMargin: bigint, maxLiquidationReward: bigint})> { + return this.eth_call(functions.getRequiredMargins, [accountId]) + } + + getWithdrawableMargin(accountId: bigint): Promise { + return this.eth_call(functions.getWithdrawableMargin, [accountId]) + } + + totalAccountOpenInterest(accountId: bigint): Promise { + return this.eth_call(functions.totalAccountOpenInterest, [accountId]) + } + + totalCollateralValue(accountId: bigint): Promise { + return this.eth_call(functions.totalCollateralValue, [accountId]) + } + + currentFundingRate(marketId: bigint): Promise { + return this.eth_call(functions.currentFundingRate, [marketId]) + } + + currentFundingVelocity(marketId: bigint): Promise { + return this.eth_call(functions.currentFundingVelocity, [marketId]) + } + + fillPrice(marketId: bigint, orderSize: bigint, price: bigint): Promise { + return this.eth_call(functions.fillPrice, [marketId, orderSize, price]) + } + + getMarketSummary(marketId: bigint): Promise<([skew: bigint, size: bigint, maxOpenInterest: bigint, currentFundingRate: bigint, currentFundingVelocity: bigint, indexPrice: bigint] & {skew: bigint, size: bigint, maxOpenInterest: bigint, currentFundingRate: bigint, currentFundingVelocity: bigint, indexPrice: bigint})> { + return this.eth_call(functions.getMarketSummary, [marketId]) + } + + indexPrice(marketId: bigint): Promise { + return this.eth_call(functions.indexPrice, [marketId]) + } + + maxOpenInterest(marketId: bigint): Promise { + return this.eth_call(functions.maxOpenInterest, [marketId]) + } + + metadata(marketId: bigint): Promise<([name: string, symbol: string] & {name: string, symbol: string})> { + return this.eth_call(functions.metadata, [marketId]) + } + + size(marketId: bigint): Promise { + return this.eth_call(functions.size, [marketId]) + } + + skew(marketId: bigint): Promise { + return this.eth_call(functions.skew, [marketId]) + } + + computeOrderFees(marketId: bigint, sizeDelta: bigint): Promise<([orderFees: bigint, fillPrice: bigint] & {orderFees: bigint, fillPrice: bigint})> { + return this.eth_call(functions.computeOrderFees, [marketId, sizeDelta]) + } + + computeOrderFeesWithPrice(marketId: bigint, sizeDelta: bigint, price: bigint): Promise<([orderFees: bigint, fillPrice: bigint] & {orderFees: bigint, fillPrice: bigint})> { + return this.eth_call(functions.computeOrderFeesWithPrice, [marketId, sizeDelta, price]) + } + + getOrder(accountId: bigint): Promise<([commitmentTime: bigint, request: ([marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string] & {marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string})] & {commitmentTime: bigint, request: ([marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string] & {marketId: bigint, accountId: bigint, sizeDelta: bigint, settlementStrategyId: bigint, acceptablePrice: bigint, trackingCode: string, referrer: string})})> { + return this.eth_call(functions.getOrder, [accountId]) + } + + getSettlementRewardCost(marketId: bigint, settlementStrategyId: bigint): Promise { + return this.eth_call(functions.getSettlementRewardCost, [marketId, settlementStrategyId]) + } + + requiredMarginForOrder(accountId: bigint, marketId: bigint, sizeDelta: bigint): Promise { + return this.eth_call(functions.requiredMarginForOrder, [accountId, marketId, sizeDelta]) + } + + requiredMarginForOrderWithPrice(accountId: bigint, marketId: bigint, sizeDelta: bigint, price: bigint): Promise { + return this.eth_call(functions.requiredMarginForOrderWithPrice, [accountId, marketId, sizeDelta, price]) + } + + getDeniers(feature: string): Promise> { + return this.eth_call(functions.getDeniers, [feature]) + } + + getFeatureFlagAllowAll(feature: string): Promise { + return this.eth_call(functions.getFeatureFlagAllowAll, [feature]) + } + + getFeatureFlagAllowlist(feature: string): Promise> { + return this.eth_call(functions.getFeatureFlagAllowlist, [feature]) + } + + getFeatureFlagDenyAll(feature: string): Promise { + return this.eth_call(functions.getFeatureFlagDenyAll, [feature]) + } + + isFeatureAllowed(feature: string, account: string): Promise { + return this.eth_call(functions.isFeatureAllowed, [feature, account]) + } + + canLiquidate(accountId: bigint): Promise { + return this.eth_call(functions.canLiquidate, [accountId]) + } + + canLiquidateMarginOnly(accountId: bigint): Promise { + return this.eth_call(functions.canLiquidateMarginOnly, [accountId]) + } + + flaggedAccounts(): Promise> { + return this.eth_call(functions.flaggedAccounts, []) + } + + liquidationCapacity(marketId: bigint): Promise<([capacity: bigint, maxLiquidationInWindow: bigint, latestLiquidationTimestamp: bigint] & {capacity: bigint, maxLiquidationInWindow: bigint, latestLiquidationTimestamp: bigint})> { + return this.eth_call(functions.liquidationCapacity, [marketId]) + } + + getFundingParameters(marketId: bigint): Promise<([skewScale: bigint, maxFundingVelocity: bigint] & {skewScale: bigint, maxFundingVelocity: bigint})> { + return this.eth_call(functions.getFundingParameters, [marketId]) + } + + getLiquidationParameters(marketId: bigint): Promise<([initialMarginRatioD18: bigint, minimumInitialMarginRatioD18: bigint, maintenanceMarginScalarD18: bigint, flagRewardRatioD18: bigint, minimumPositionMargin: bigint] & {initialMarginRatioD18: bigint, minimumInitialMarginRatioD18: bigint, maintenanceMarginScalarD18: bigint, flagRewardRatioD18: bigint, minimumPositionMargin: bigint})> { + return this.eth_call(functions.getLiquidationParameters, [marketId]) + } + + getLockedOiRatio(marketId: bigint): Promise { + return this.eth_call(functions.getLockedOiRatio, [marketId]) + } + + getMaxLiquidationParameters(marketId: bigint): Promise<([maxLiquidationLimitAccumulationMultiplier: bigint, maxSecondsInLiquidationWindow: bigint, maxLiquidationPd: bigint, endorsedLiquidator: string] & {maxLiquidationLimitAccumulationMultiplier: bigint, maxSecondsInLiquidationWindow: bigint, maxLiquidationPd: bigint, endorsedLiquidator: string})> { + return this.eth_call(functions.getMaxLiquidationParameters, [marketId]) + } + + getMaxMarketSize(marketId: bigint): Promise { + return this.eth_call(functions.getMaxMarketSize, [marketId]) + } + + getMaxMarketValue(marketId: bigint): Promise { + return this.eth_call(functions.getMaxMarketValue, [marketId]) + } + + getOrderFees(marketId: bigint): Promise<([makerFee: bigint, takerFee: bigint] & {makerFee: bigint, takerFee: bigint})> { + return this.eth_call(functions.getOrderFees, [marketId]) + } + + getPriceData(perpsMarketId: bigint): Promise<([feedId: string, strictStalenessTolerance: bigint] & {feedId: string, strictStalenessTolerance: bigint})> { + return this.eth_call(functions.getPriceData, [perpsMarketId]) + } + + getSettlementStrategy(marketId: bigint, strategyId: bigint): Promise<([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, settlementReward: bigint, disabled: boolean, commitmentPriceDelay: bigint})> { + return this.eth_call(functions.getSettlementStrategy, [marketId, strategyId]) + } + + getCollateralConfiguration(collateralId: bigint): Promise { + return this.eth_call(functions.getCollateralConfiguration, [collateralId]) + } + + getCollateralConfigurationFull(collateralId: bigint): Promise<([maxCollateralAmount: bigint, upperLimitDiscount: bigint, lowerLimitDiscount: bigint, discountScalar: bigint] & {maxCollateralAmount: bigint, upperLimitDiscount: bigint, lowerLimitDiscount: bigint, discountScalar: bigint})> { + return this.eth_call(functions.getCollateralConfigurationFull, [collateralId]) + } + + getCollateralLiquidateRewardRatio(): Promise { + return this.eth_call(functions.getCollateralLiquidateRewardRatio, []) + } + + getRegisteredDistributor(collateralId: bigint): Promise<([distributor: string, poolDelegatedCollateralTypes: Array] & {distributor: string, poolDelegatedCollateralTypes: Array})> { + return this.eth_call(functions.getRegisteredDistributor, [collateralId]) + } + + isRegistered(distributor: string): Promise { + return this.eth_call(functions.isRegistered, [distributor]) + } + + getFeeCollector(): Promise { + return this.eth_call(functions.getFeeCollector, []) + } + + getInterestRateParameters(): Promise<([lowUtilizationInterestRateGradient: bigint, interestRateGradientBreakpoint: bigint, highUtilizationInterestRateGradient: bigint] & {lowUtilizationInterestRateGradient: bigint, interestRateGradientBreakpoint: bigint, highUtilizationInterestRateGradient: bigint})> { + return this.eth_call(functions.getInterestRateParameters, []) + } + + getKeeperCostNodeId(): Promise { + return this.eth_call(functions.getKeeperCostNodeId, []) + } + + getKeeperRewardGuards(): Promise<([minKeeperRewardUsd: bigint, minKeeperProfitRatioD18: bigint, maxKeeperRewardUsd: bigint, maxKeeperScalingRatioD18: bigint] & {minKeeperRewardUsd: bigint, minKeeperProfitRatioD18: bigint, maxKeeperRewardUsd: bigint, maxKeeperScalingRatioD18: bigint})> { + return this.eth_call(functions.getKeeperRewardGuards, []) + } + + getMarkets(): Promise> { + return this.eth_call(functions.getMarkets, []) + } + + getPerAccountCaps(): Promise<([maxPositionsPerAccount: bigint, maxCollateralsPerAccount: bigint] & {maxPositionsPerAccount: bigint, maxCollateralsPerAccount: bigint})> { + return this.eth_call(functions.getPerAccountCaps, []) + } + + getReferrerShare(referrer: string): Promise { + return this.eth_call(functions.getReferrerShare, [referrer]) + } + + getSupportedCollaterals(): Promise> { + return this.eth_call(functions.getSupportedCollaterals, []) + } + + globalCollateralValue(collateralId: bigint): Promise { + return this.eth_call(functions.globalCollateralValue, [collateralId]) + } + + totalGlobalCollateralValue(): Promise { + return this.eth_call(functions.totalGlobalCollateralValue, []) + } +} diff --git a/indexers/arbitrum-sepolia/src/abi/SpotMarketProxy.abi.ts b/indexers/arbitrum-sepolia/src/abi/SpotMarketProxy.abi.ts new file mode 100644 index 00000000..29fcd6c3 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/abi/SpotMarketProxy.abi.ts @@ -0,0 +1,3527 @@ +export const ABI_JSON = [ + { + "type": "error", + "name": "ImplementationIsSterile", + "inputs": [ + { + "type": "address", + "name": "implementation" + } + ] + }, + { + "type": "error", + "name": "NoChange", + "inputs": [] + }, + { + "type": "error", + "name": "NotAContract", + "inputs": [ + { + "type": "address", + "name": "contr" + } + ] + }, + { + "type": "error", + "name": "NotNominated", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "Unauthorized", + "inputs": [ + { + "type": "address", + "name": "addr" + } + ] + }, + { + "type": "error", + "name": "UpgradeSimulationFailed", + "inputs": [] + }, + { + "type": "error", + "name": "ZeroAddress", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "OwnerChanged", + "inputs": [ + { + "type": "address", + "name": "oldOwner", + "indexed": false + }, + { + "type": "address", + "name": "newOwner", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "OwnerNominated", + "inputs": [ + { + "type": "address", + "name": "newOwner", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Upgraded", + "inputs": [ + { + "type": "address", + "name": "self", + "indexed": true + }, + { + "type": "address", + "name": "implementation", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "acceptOwnership", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "getImplementation", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "nominateNewOwner", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newNominatedOwner" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "nominatedOwner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "owner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "renounceNomination", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "simulateUpgradeTo", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newImplementation" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "upgradeTo", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "newImplementation" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "FeatureUnavailable", + "inputs": [ + { + "type": "bytes32", + "name": "which" + } + ] + }, + { + "type": "error", + "name": "InvalidMarketOwner", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidSynthImplementation", + "inputs": [ + { + "type": "uint256", + "name": "synthImplementation" + } + ] + }, + { + "type": "error", + "name": "MismatchAssociatedSystemKind", + "inputs": [ + { + "type": "bytes32", + "name": "expected" + }, + { + "type": "bytes32", + "name": "actual" + } + ] + }, + { + "type": "error", + "name": "MissingAssociatedSystem", + "inputs": [ + { + "type": "bytes32", + "name": "id" + } + ] + }, + { + "type": "error", + "name": "OnlyMarketOwner", + "inputs": [ + { + "type": "address", + "name": "marketOwner" + }, + { + "type": "address", + "name": "sender" + } + ] + }, + { + "type": "error", + "name": "OverflowInt256ToUint256", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "AssociatedSystemSet", + "inputs": [ + { + "type": "bytes32", + "name": "kind", + "indexed": true + }, + { + "type": "bytes32", + "name": "id", + "indexed": true + }, + { + "type": "address", + "name": "proxy", + "indexed": false + }, + { + "type": "address", + "name": "impl", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "DecayRateUpdated", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint256", + "name": "rate", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketNominationRenounced", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "address", + "name": "nominee", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketOwnerChanged", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "address", + "name": "oldOwner", + "indexed": false + }, + { + "type": "address", + "name": "newOwner", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketOwnerNominated", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "address", + "name": "newOwner", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SynthImplementationSet", + "inputs": [ + { + "type": "address", + "name": "synthImplementation", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SynthImplementationUpgraded", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "address", + "name": "proxy", + "indexed": true + }, + { + "type": "address", + "name": "implementation", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SynthPriceDataUpdated", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "bytes32", + "name": "buyFeedId", + "indexed": true + }, + { + "type": "bytes32", + "name": "sellFeedId", + "indexed": true + }, + { + "type": "uint256", + "name": "strictStalenessTolerance", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SynthRegistered", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "address", + "name": "synthTokenAddress", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SynthetixSystemSet", + "inputs": [ + { + "type": "address", + "name": "synthetix", + "indexed": false + }, + { + "type": "address", + "name": "usdTokenAddress", + "indexed": false + }, + { + "type": "address", + "name": "oracleManager", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "acceptMarketOwnership", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "createSynth", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "string", + "name": "tokenName" + }, + { + "type": "string", + "name": "tokenSymbol" + }, + { + "type": "address", + "name": "synthOwner" + } + ], + "outputs": [ + { + "type": "uint128", + "name": "synthMarketId" + } + ] + }, + { + "type": "function", + "name": "getAssociatedSystem", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "id" + } + ], + "outputs": [ + { + "type": "address", + "name": "addr" + }, + { + "type": "bytes32", + "name": "kind" + } + ] + }, + { + "type": "function", + "name": "getMarketOwner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + } + ], + "outputs": [ + { + "type": "address", + "name": "marketOwner" + } + ] + }, + { + "type": "function", + "name": "getNominatedMarketOwner", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + } + ], + "outputs": [ + { + "type": "address", + "name": "marketOwner" + } + ] + }, + { + "type": "function", + "name": "getPriceData", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + } + ], + "outputs": [ + { + "type": "bytes32", + "name": "buyFeedId" + }, + { + "type": "bytes32", + "name": "sellFeedId" + }, + { + "type": "uint256", + "name": "strictPriceStalenessTolerance" + } + ] + }, + { + "type": "function", + "name": "getSynth", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "address", + "name": "synthAddress" + } + ] + }, + { + "type": "function", + "name": "getSynthImpl", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "address", + "name": "implAddress" + } + ] + }, + { + "type": "function", + "name": "initOrUpgradeNft", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "id" + }, + { + "type": "string", + "name": "name" + }, + { + "type": "string", + "name": "symbol" + }, + { + "type": "string", + "name": "uri" + }, + { + "type": "address", + "name": "impl" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "initOrUpgradeToken", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "id" + }, + { + "type": "string", + "name": "name" + }, + { + "type": "string", + "name": "symbol" + }, + { + "type": "uint8", + "name": "decimals" + }, + { + "type": "address", + "name": "impl" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "minimumCredit", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "lockedAmount" + } + ] + }, + { + "type": "function", + "name": "name", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "string", + "name": "marketName" + } + ] + }, + { + "type": "function", + "name": "nominateMarketOwner", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "address", + "name": "newNominatedOwner" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "registerUnmanagedSystem", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "id" + }, + { + "type": "address", + "name": "endpoint" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "renounceMarketNomination", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "renounceMarketOwnership", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "reportedDebt", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "reportedDebtAmount" + } + ] + }, + { + "type": "function", + "name": "setDecayRate", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "rate" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setSynthImplementation", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "synthImplementation" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setSynthetix", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "synthetix" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "supportsInterface", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes4", + "name": "interfaceId" + } + ], + "outputs": [ + { + "type": "bool", + "name": "isSupported" + } + ] + }, + { + "type": "function", + "name": "updatePriceData", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "bytes32", + "name": "buyFeedId" + }, + { + "type": "bytes32", + "name": "sellFeedId" + }, + { + "type": "uint256", + "name": "strictPriceStalenessTolerance" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "upgradeSynthImpl", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "ExceedsMaxSynthAmount", + "inputs": [ + { + "type": "uint256", + "name": "maxSynthAmount" + }, + { + "type": "uint256", + "name": "synthAmountCharged" + } + ] + }, + { + "type": "error", + "name": "ExceedsMaxUsdAmount", + "inputs": [ + { + "type": "uint256", + "name": "maxUsdAmount" + }, + { + "type": "uint256", + "name": "usdAmountCharged" + } + ] + }, + { + "type": "error", + "name": "InsufficientAmountReceived", + "inputs": [ + { + "type": "uint256", + "name": "expected" + }, + { + "type": "uint256", + "name": "current" + } + ] + }, + { + "type": "error", + "name": "InvalidMarket", + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ] + }, + { + "type": "error", + "name": "InvalidPrices", + "inputs": [] + }, + { + "type": "error", + "name": "OverflowUint256ToInt256", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "SynthBought", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "uint256", + "name": "synthReturned", + "indexed": false + }, + { + "type": "tuple", + "name": "fees", + "indexed": false, + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + }, + { + "type": "uint256", + "name": "collectedFees", + "indexed": false + }, + { + "type": "address", + "name": "referrer", + "indexed": false + }, + { + "type": "uint256", + "name": "price", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SynthSold", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "uint256", + "name": "amountReturned", + "indexed": false + }, + { + "type": "tuple", + "name": "fees", + "indexed": false, + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + }, + { + "type": "uint256", + "name": "collectedFees", + "indexed": false + }, + { + "type": "address", + "name": "referrer", + "indexed": false + }, + { + "type": "uint256", + "name": "price", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "buy", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "usdAmount" + }, + { + "type": "uint256", + "name": "minAmountReceived" + }, + { + "type": "address", + "name": "referrer" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "synthAmount" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "function", + "name": "buyExactIn", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "usdAmount" + }, + { + "type": "uint256", + "name": "minAmountReceived" + }, + { + "type": "address", + "name": "referrer" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "synthAmount" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "function", + "name": "buyExactOut", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "synthAmount" + }, + { + "type": "uint256", + "name": "maxUsdAmount" + }, + { + "type": "address", + "name": "referrer" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "usdAmountCharged" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "function", + "name": "getMarketSkew", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "int256", + "name": "marketSkew" + } + ] + }, + { + "type": "function", + "name": "quoteBuyExactIn", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "usdAmount" + }, + { + "type": "uint8", + "name": "stalenessTolerance" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "synthAmount" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "function", + "name": "quoteBuyExactOut", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "synthAmount" + }, + { + "type": "uint8", + "name": "stalenessTolerance" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "usdAmountCharged" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "function", + "name": "quoteSellExactIn", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "synthAmount" + }, + { + "type": "uint8", + "name": "stalenessTolerance" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "returnAmount" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "function", + "name": "quoteSellExactOut", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "usdAmount" + }, + { + "type": "uint8", + "name": "stalenessTolerance" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "synthToBurn" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "function", + "name": "sell", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "synthAmount" + }, + { + "type": "uint256", + "name": "minUsdAmount" + }, + { + "type": "address", + "name": "referrer" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "usdAmountReceived" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "function", + "name": "sellExactIn", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "synthAmount" + }, + { + "type": "uint256", + "name": "minAmountReceived" + }, + { + "type": "address", + "name": "referrer" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "returnAmount" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "function", + "name": "sellExactOut", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "usdAmount" + }, + { + "type": "uint256", + "name": "maxSynthAmount" + }, + { + "type": "address", + "name": "referrer" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "synthToBurn" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "error", + "name": "IneligibleForCancellation", + "inputs": [ + { + "type": "uint256", + "name": "timestamp" + }, + { + "type": "uint256", + "name": "expirationTime" + } + ] + }, + { + "type": "error", + "name": "InsufficientSharesAmount", + "inputs": [ + { + "type": "uint256", + "name": "expected" + }, + { + "type": "uint256", + "name": "actual" + } + ] + }, + { + "type": "error", + "name": "InvalidAsyncTransactionType", + "inputs": [ + { + "type": "uint8", + "name": "transactionType" + } + ] + }, + { + "type": "error", + "name": "InvalidClaim", + "inputs": [ + { + "type": "uint256", + "name": "asyncOrderId" + } + ] + }, + { + "type": "error", + "name": "InvalidCommitmentAmount", + "inputs": [ + { + "type": "uint256", + "name": "minimumAmount" + }, + { + "type": "uint256", + "name": "amount" + } + ] + }, + { + "type": "error", + "name": "InvalidSettlementStrategy", + "inputs": [ + { + "type": "uint256", + "name": "settlementStrategyId" + } + ] + }, + { + "type": "error", + "name": "OrderAlreadySettled", + "inputs": [ + { + "type": "uint256", + "name": "asyncOrderId" + }, + { + "type": "uint256", + "name": "settledAt" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "OrderCancelled", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint128", + "name": "asyncOrderId", + "indexed": true + }, + { + "type": "tuple", + "name": "asyncOrderClaim", + "indexed": false, + "components": [ + { + "type": "uint128", + "name": "id" + }, + { + "type": "address", + "name": "owner" + }, + { + "type": "uint8", + "name": "orderType" + }, + { + "type": "uint256", + "name": "amountEscrowed" + }, + { + "type": "uint256", + "name": "settlementStrategyId" + }, + { + "type": "uint256", + "name": "commitmentTime" + }, + { + "type": "uint256", + "name": "minimumSettlementAmount" + }, + { + "type": "uint256", + "name": "settledAt" + }, + { + "type": "address", + "name": "referrer" + } + ] + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "OrderCommitted", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint8", + "name": "orderType", + "indexed": true + }, + { + "type": "uint256", + "name": "amountProvided", + "indexed": false + }, + { + "type": "uint128", + "name": "asyncOrderId", + "indexed": false + }, + { + "type": "address", + "name": "sender", + "indexed": true + }, + { + "type": "address", + "name": "referrer", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "cancelOrder", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "asyncOrderId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "commitOrder", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint8", + "name": "orderType" + }, + { + "type": "uint256", + "name": "amountProvided" + }, + { + "type": "uint256", + "name": "settlementStrategyId" + }, + { + "type": "uint256", + "name": "minimumSettlementAmount" + }, + { + "type": "address", + "name": "referrer" + } + ], + "outputs": [ + { + "type": "tuple", + "name": "asyncOrderClaim", + "components": [ + { + "type": "uint128", + "name": "id" + }, + { + "type": "address", + "name": "owner" + }, + { + "type": "uint8", + "name": "orderType" + }, + { + "type": "uint256", + "name": "amountEscrowed" + }, + { + "type": "uint256", + "name": "settlementStrategyId" + }, + { + "type": "uint256", + "name": "commitmentTime" + }, + { + "type": "uint256", + "name": "minimumSettlementAmount" + }, + { + "type": "uint256", + "name": "settledAt" + }, + { + "type": "address", + "name": "referrer" + } + ] + } + ] + }, + { + "type": "function", + "name": "getAsyncOrderClaim", + "constant": true, + "stateMutability": "pure", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "asyncOrderId" + } + ], + "outputs": [ + { + "type": "tuple", + "name": "asyncOrderClaim", + "components": [ + { + "type": "uint128", + "name": "id" + }, + { + "type": "address", + "name": "owner" + }, + { + "type": "uint8", + "name": "orderType" + }, + { + "type": "uint256", + "name": "amountEscrowed" + }, + { + "type": "uint256", + "name": "settlementStrategyId" + }, + { + "type": "uint256", + "name": "commitmentTime" + }, + { + "type": "uint256", + "name": "minimumSettlementAmount" + }, + { + "type": "uint256", + "name": "settledAt" + }, + { + "type": "address", + "name": "referrer" + } + ] + } + ] + }, + { + "type": "error", + "name": "InvalidSettlementStrategy", + "inputs": [ + { + "type": "uint8", + "name": "strategyType" + } + ] + }, + { + "type": "error", + "name": "InvalidVerificationResponse", + "inputs": [] + }, + { + "type": "error", + "name": "MinimumSettlementAmountNotMet", + "inputs": [ + { + "type": "uint256", + "name": "minimum" + }, + { + "type": "uint256", + "name": "actual" + } + ] + }, + { + "type": "error", + "name": "OutsideSettlementWindow", + "inputs": [ + { + "type": "uint256", + "name": "timestamp" + }, + { + "type": "uint256", + "name": "startTime" + }, + { + "type": "uint256", + "name": "expirationTime" + } + ] + }, + { + "type": "error", + "name": "OverflowUint256ToUint64", + "inputs": [] + }, + { + "type": "error", + "name": "SettlementStrategyNotFound", + "inputs": [ + { + "type": "uint8", + "name": "strategyType" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "OrderSettled", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "uint128", + "name": "asyncOrderId", + "indexed": true + }, + { + "type": "uint256", + "name": "finalOrderAmount", + "indexed": false + }, + { + "type": "tuple", + "name": "fees", + "indexed": false, + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + }, + { + "type": "uint256", + "name": "collectedFees", + "indexed": false + }, + { + "type": "address", + "name": "settler", + "indexed": true + }, + { + "type": "uint256", + "name": "price", + "indexed": false + }, + { + "type": "uint8", + "name": "orderType", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "settleOrder", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "asyncOrderId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "finalOrderAmount" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "error", + "name": "InvalidSettlementWindowDuration", + "inputs": [ + { + "type": "uint256", + "name": "duration" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SettlementStrategyAdded", + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "uint256", + "name": "strategyId", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SettlementStrategySet", + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "uint256", + "name": "strategyId", + "indexed": true + }, + { + "type": "tuple", + "name": "strategy", + "indexed": false, + "components": [ + { + "type": "uint8", + "name": "strategyType" + }, + { + "type": "uint256", + "name": "settlementDelay" + }, + { + "type": "uint256", + "name": "settlementWindowDuration" + }, + { + "type": "address", + "name": "priceVerificationContract" + }, + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "string", + "name": "url" + }, + { + "type": "uint256", + "name": "settlementReward" + }, + { + "type": "uint256", + "name": "priceDeviationTolerance" + }, + { + "type": "uint256", + "name": "minimumUsdExchangeAmount" + }, + { + "type": "uint256", + "name": "maxRoundingLoss" + }, + { + "type": "bool", + "name": "disabled" + } + ] + } + ] + }, + { + "type": "function", + "name": "addSettlementStrategy", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "tuple", + "name": "strategy", + "components": [ + { + "type": "uint8", + "name": "strategyType" + }, + { + "type": "uint256", + "name": "settlementDelay" + }, + { + "type": "uint256", + "name": "settlementWindowDuration" + }, + { + "type": "address", + "name": "priceVerificationContract" + }, + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "string", + "name": "url" + }, + { + "type": "uint256", + "name": "settlementReward" + }, + { + "type": "uint256", + "name": "priceDeviationTolerance" + }, + { + "type": "uint256", + "name": "minimumUsdExchangeAmount" + }, + { + "type": "uint256", + "name": "maxRoundingLoss" + }, + { + "type": "bool", + "name": "disabled" + } + ] + } + ], + "outputs": [ + { + "type": "uint256", + "name": "strategyId" + } + ] + }, + { + "type": "function", + "name": "getSettlementStrategy", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "strategyId" + } + ], + "outputs": [ + { + "type": "tuple", + "name": "settlementStrategy", + "components": [ + { + "type": "uint8", + "name": "strategyType" + }, + { + "type": "uint256", + "name": "settlementDelay" + }, + { + "type": "uint256", + "name": "settlementWindowDuration" + }, + { + "type": "address", + "name": "priceVerificationContract" + }, + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "string", + "name": "url" + }, + { + "type": "uint256", + "name": "settlementReward" + }, + { + "type": "uint256", + "name": "priceDeviationTolerance" + }, + { + "type": "uint256", + "name": "minimumUsdExchangeAmount" + }, + { + "type": "uint256", + "name": "maxRoundingLoss" + }, + { + "type": "bool", + "name": "disabled" + } + ] + } + ] + }, + { + "type": "function", + "name": "setSettlementStrategy", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "strategyId" + }, + { + "type": "tuple", + "name": "strategy", + "components": [ + { + "type": "uint8", + "name": "strategyType" + }, + { + "type": "uint256", + "name": "settlementDelay" + }, + { + "type": "uint256", + "name": "settlementWindowDuration" + }, + { + "type": "address", + "name": "priceVerificationContract" + }, + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "string", + "name": "url" + }, + { + "type": "uint256", + "name": "settlementReward" + }, + { + "type": "uint256", + "name": "priceDeviationTolerance" + }, + { + "type": "uint256", + "name": "minimumUsdExchangeAmount" + }, + { + "type": "uint256", + "name": "maxRoundingLoss" + }, + { + "type": "bool", + "name": "disabled" + } + ] + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setSettlementStrategyEnabled", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "strategyId" + }, + { + "type": "bool", + "name": "enabled" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "FailedTransfer", + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "value" + } + ] + }, + { + "type": "error", + "name": "InvalidCollateralType", + "inputs": [ + { + "type": "address", + "name": "configuredCollateralType" + } + ] + }, + { + "type": "error", + "name": "WrapperExceedsMaxAmount", + "inputs": [ + { + "type": "uint256", + "name": "maxWrappableAmount" + }, + { + "type": "uint256", + "name": "currentSupply" + }, + { + "type": "uint256", + "name": "amountToWrap" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SynthUnwrapped", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "uint256", + "name": "amountUnwrapped", + "indexed": false + }, + { + "type": "tuple", + "name": "fees", + "indexed": false, + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + }, + { + "type": "uint256", + "name": "feesCollected", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SynthWrapped", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "uint256", + "name": "amountWrapped", + "indexed": false + }, + { + "type": "tuple", + "name": "fees", + "indexed": false, + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + }, + { + "type": "uint256", + "name": "feesCollected", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "WrapperSet", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "address", + "name": "wrapCollateralType", + "indexed": true + }, + { + "type": "uint256", + "name": "maxWrappableAmount", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "getWrapper", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + } + ], + "outputs": [ + { + "type": "address", + "name": "wrapCollateralType" + }, + { + "type": "uint256", + "name": "maxWrappableAmount" + } + ] + }, + { + "type": "function", + "name": "setWrapper", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "address", + "name": "wrapCollateralType" + }, + { + "type": "uint256", + "name": "maxWrappableAmount" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "unwrap", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "unwrapAmount" + }, + { + "type": "uint256", + "name": "minAmountReceived" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "returnCollateralAmount" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "function", + "name": "wrap", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint256", + "name": "wrapAmount" + }, + { + "type": "uint256", + "name": "minAmountReceived" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "amountToMint" + }, + { + "type": "tuple", + "name": "fees", + "components": [ + { + "type": "uint256", + "name": "fixedFees" + }, + { + "type": "uint256", + "name": "utilizationFees" + }, + { + "type": "int256", + "name": "skewFees" + }, + { + "type": "int256", + "name": "wrapperFees" + } + ] + } + ] + }, + { + "type": "error", + "name": "InvalidCollateralLeverage", + "inputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "error", + "name": "InvalidFeeCollectorInterface", + "inputs": [ + { + "type": "address", + "name": "invalidFeeCollector" + } + ] + }, + { + "type": "error", + "name": "InvalidWrapperFees", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "AsyncFixedFeeSet", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "uint256", + "name": "asyncFixedFee", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "AtomicFixedFeeSet", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "uint256", + "name": "atomicFixedFee", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "CollateralLeverageSet", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "uint256", + "name": "collateralLeverage", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeeCollectorSet", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "address", + "name": "feeCollector", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketSkewScaleSet", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "uint256", + "name": "skewScale", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "MarketUtilizationFeesSet", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "uint256", + "name": "utilizationFeeRate", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "ReferrerShareUpdated", + "inputs": [ + { + "type": "uint128", + "name": "marketId", + "indexed": true + }, + { + "type": "address", + "name": "referrer", + "indexed": false + }, + { + "type": "uint256", + "name": "sharePercentage", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "TransactorFixedFeeSet", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "address", + "name": "transactor", + "indexed": false + }, + { + "type": "uint256", + "name": "fixedFeeAmount", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "WrapperFeesSet", + "inputs": [ + { + "type": "uint256", + "name": "synthMarketId", + "indexed": true + }, + { + "type": "int256", + "name": "wrapFee", + "indexed": false + }, + { + "type": "int256", + "name": "unwrapFee", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "getCollateralLeverage", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "collateralLeverage" + } + ] + }, + { + "type": "function", + "name": "getCustomTransactorFees", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "address", + "name": "transactor" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "fixedFeeAmount" + } + ] + }, + { + "type": "function", + "name": "getFeeCollector", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + } + ], + "outputs": [ + { + "type": "address", + "name": "feeCollector" + } + ] + }, + { + "type": "function", + "name": "getMarketFees", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "atomicFixedFee" + }, + { + "type": "uint256", + "name": "asyncFixedFee" + }, + { + "type": "int256", + "name": "wrapFee" + }, + { + "type": "int256", + "name": "unwrapFee" + } + ] + }, + { + "type": "function", + "name": "getMarketSkewScale", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "skewScale" + } + ] + }, + { + "type": "function", + "name": "getMarketUtilizationFees", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "utilizationFeeRate" + } + ] + }, + { + "type": "function", + "name": "getReferrerShare", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "address", + "name": "referrer" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "sharePercentage" + } + ] + }, + { + "type": "function", + "name": "setAsyncFixedFee", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "uint256", + "name": "asyncFixedFee" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setAtomicFixedFee", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "uint256", + "name": "atomicFixedFee" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setCollateralLeverage", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "uint256", + "name": "collateralLeverage" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setCustomTransactorFees", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "address", + "name": "transactor" + }, + { + "type": "uint256", + "name": "fixedFeeAmount" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setFeeCollector", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "address", + "name": "feeCollector" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setMarketSkewScale", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "uint256", + "name": "skewScale" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setMarketUtilizationFees", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "uint256", + "name": "utilizationFeeRate" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setWrapperFees", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "int256", + "name": "wrapFee" + }, + { + "type": "int256", + "name": "unwrapFee" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "updateReferrerShare", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint128", + "name": "synthMarketId" + }, + { + "type": "address", + "name": "referrer" + }, + { + "type": "uint256", + "name": "sharePercentage" + } + ], + "outputs": [] + }, + { + "type": "error", + "name": "ValueAlreadyInSet", + "inputs": [] + }, + { + "type": "error", + "name": "ValueNotInSet", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagAllowAllSet", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "bool", + "name": "allowAll", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagAllowlistAdded", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "address", + "name": "account", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagAllowlistRemoved", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "address", + "name": "account", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagDeniersReset", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "address[]", + "name": "deniers" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "FeatureFlagDenyAllSet", + "inputs": [ + { + "type": "bytes32", + "name": "feature", + "indexed": true + }, + { + "type": "bool", + "name": "denyAll", + "indexed": false + } + ] + }, + { + "type": "function", + "name": "addToFeatureFlagAllowlist", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getDeniers", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + } + ], + "outputs": [ + { + "type": "address[]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getFeatureFlagAllowAll", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getFeatureFlagAllowlist", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + } + ], + "outputs": [ + { + "type": "address[]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getFeatureFlagDenyAll", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isFeatureAllowed", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "removeFromFeatureFlagAllowlist", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setDeniers", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "address[]", + "name": "deniers" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setFeatureFlagAllowAll", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "bool", + "name": "allowAll" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setFeatureFlagDenyAll", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "feature" + }, + { + "type": "bool", + "name": "denyAll" + } + ], + "outputs": [] + } +] diff --git a/indexers/arbitrum-sepolia/src/abi/SpotMarketProxy.ts b/indexers/arbitrum-sepolia/src/abi/SpotMarketProxy.ts new file mode 100644 index 00000000..d3dca676 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/abi/SpotMarketProxy.ts @@ -0,0 +1,497 @@ +import * as ethers from 'ethers' +import {LogEvent, Func, ContractBase} from './abi.support' +import {ABI_JSON} from './SpotMarketProxy.abi' + +export const abi = new ethers.Interface(ABI_JSON); + +export const events = { + OwnerChanged: new LogEvent<([oldOwner: string, newOwner: string] & {oldOwner: string, newOwner: string})>( + abi, '0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c' + ), + OwnerNominated: new LogEvent<([newOwner: string] & {newOwner: string})>( + abi, '0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22' + ), + Upgraded: new LogEvent<([self: string, implementation: string] & {self: string, implementation: string})>( + abi, '0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7' + ), + AssociatedSystemSet: new LogEvent<([kind: string, id: string, proxy: string, impl: string] & {kind: string, id: string, proxy: string, impl: string})>( + abi, '0xc8551a5a03a7b06d5d20159b3b8839429a7aefab4bf3d020f1b65fa903ccb3d2' + ), + DecayRateUpdated: new LogEvent<([marketId: bigint, rate: bigint] & {marketId: bigint, rate: bigint})>( + abi, '0x8a1ed33cd71d1533eadd1d4eb0ea2ae64da7d343cb2a932fdf135f345264e2b5' + ), + MarketNominationRenounced: new LogEvent<([marketId: bigint, nominee: string] & {marketId: bigint, nominee: string})>( + abi, '0xf5b87e3c7e0caa8e0d233591fff85e764ebc73d5c7027cce729fd4beab04c2b6' + ), + MarketOwnerChanged: new LogEvent<([marketId: bigint, oldOwner: string, newOwner: string] & {marketId: bigint, oldOwner: string, newOwner: string})>( + abi, '0xe73c996387b656d1e0ea2866c854ed68122ce4e4eea51d6af012938b3c7ff52f' + ), + MarketOwnerNominated: new LogEvent<([marketId: bigint, newOwner: string] & {marketId: bigint, newOwner: string})>( + abi, '0x54605d90ee82d9b4318b0b4b479f3966976e44b94c6aff221c04f5294f85016b' + ), + SynthImplementationSet: new LogEvent<([synthImplementation: string] & {synthImplementation: string})>( + abi, '0xafffc48b3243eba10d901f21ba761ad741f18a23feed86ca425df4974d3314b0' + ), + SynthImplementationUpgraded: new LogEvent<([synthMarketId: bigint, proxy: string, implementation: string] & {synthMarketId: bigint, proxy: string, implementation: string})>( + abi, '0xa7badace8b24daeeb3981497a506d3812b3dc6f147ef3f78bc0e2cc664c50330' + ), + SynthPriceDataUpdated: new LogEvent<([synthMarketId: bigint, buyFeedId: string, sellFeedId: string, strictStalenessTolerance: bigint] & {synthMarketId: bigint, buyFeedId: string, sellFeedId: string, strictStalenessTolerance: bigint})>( + abi, '0x814bcac408168fe72c457055f55abbaf041ad2e7ff12cdb93b058efe2216d8e9' + ), + SynthRegistered: new LogEvent<([synthMarketId: bigint, synthTokenAddress: string] & {synthMarketId: bigint, synthTokenAddress: string})>( + abi, '0x04b07b1c236913894927915a3dd91c8e250223fc668ceabdc47074c5a77e2cb9' + ), + SynthetixSystemSet: new LogEvent<([synthetix: string, usdTokenAddress: string, oracleManager: string] & {synthetix: string, usdTokenAddress: string, oracleManager: string})>( + abi, '0x52dccf7e2653d5ae8cf1d18c5499fd530f01920181d81afdf6bf489d897e24aa' + ), + SynthBought: new LogEvent<([synthMarketId: bigint, synthReturned: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint}), collectedFees: bigint, referrer: string, price: bigint] & {synthMarketId: bigint, synthReturned: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint}), collectedFees: bigint, referrer: string, price: bigint})>( + abi, '0xac82d63e679c7d862613aa8b5ccd94f9adc4986763ab14bb3351ab9092ef1303' + ), + SynthSold: new LogEvent<([synthMarketId: bigint, amountReturned: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint}), collectedFees: bigint, referrer: string, price: bigint] & {synthMarketId: bigint, amountReturned: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint}), collectedFees: bigint, referrer: string, price: bigint})>( + abi, '0x61fa4bb370a2f18a502b3bcf1d0755e53371d58791fa42766aa6386bbefb594a' + ), + OrderCancelled: new LogEvent<([marketId: bigint, asyncOrderId: bigint, asyncOrderClaim: ([id: bigint, owner: string, orderType: number, amountEscrowed: bigint, settlementStrategyId: bigint, commitmentTime: bigint, minimumSettlementAmount: bigint, settledAt: bigint, referrer: string] & {id: bigint, owner: string, orderType: number, amountEscrowed: bigint, settlementStrategyId: bigint, commitmentTime: bigint, minimumSettlementAmount: bigint, settledAt: bigint, referrer: string}), sender: string] & {marketId: bigint, asyncOrderId: bigint, asyncOrderClaim: ([id: bigint, owner: string, orderType: number, amountEscrowed: bigint, settlementStrategyId: bigint, commitmentTime: bigint, minimumSettlementAmount: bigint, settledAt: bigint, referrer: string] & {id: bigint, owner: string, orderType: number, amountEscrowed: bigint, settlementStrategyId: bigint, commitmentTime: bigint, minimumSettlementAmount: bigint, settledAt: bigint, referrer: string}), sender: string})>( + abi, '0xa57ffc5057d10e88a0dd7713d14130f9638d680af94401e7f1f4fba44a3ad5e2' + ), + OrderCommitted: new LogEvent<([marketId: bigint, orderType: number, amountProvided: bigint, asyncOrderId: bigint, sender: string, referrer: string] & {marketId: bigint, orderType: number, amountProvided: bigint, asyncOrderId: bigint, sender: string, referrer: string})>( + abi, '0xb26c216bf0a127dddc2431e4d8ca845513c8e6fb80e754296e7afab1ce92722f' + ), + OrderSettled: new LogEvent<([marketId: bigint, asyncOrderId: bigint, finalOrderAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint}), collectedFees: bigint, settler: string, price: bigint, orderType: number] & {marketId: bigint, asyncOrderId: bigint, finalOrderAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint}), collectedFees: bigint, settler: string, price: bigint, orderType: number})>( + abi, '0x6c5e8ff282d52fb9f532408e86d4afc62fc1f89c749a8ddca7a6f34c0439a183' + ), + SettlementStrategyAdded: new LogEvent<([synthMarketId: bigint, strategyId: bigint] & {synthMarketId: bigint, strategyId: bigint})>( + abi, '0x91750a8e3d84ed1bccdc79dcecf63cc1b6f83b5bf8293bf86628cbb248e487f1' + ), + SettlementStrategySet: new LogEvent<([synthMarketId: bigint, strategyId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean})] & {synthMarketId: bigint, strategyId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean})})>( + abi, '0x3b785af09c0835778dc2ef3acec91abfbcf58e48118ede60e3a33ba55ec8af3d' + ), + SynthUnwrapped: new LogEvent<([synthMarketId: bigint, amountUnwrapped: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint}), feesCollected: bigint] & {synthMarketId: bigint, amountUnwrapped: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint}), feesCollected: bigint})>( + abi, '0xa1dd74fb936c7942732e4355961ca6944ca6c6744121ace0d9a1203d664231b3' + ), + SynthWrapped: new LogEvent<([synthMarketId: bigint, amountWrapped: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint}), feesCollected: bigint] & {synthMarketId: bigint, amountWrapped: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint}), feesCollected: bigint})>( + abi, '0xea50ab2f37d37692441c4a16317c1287bb410a3a616a16c49c9ca76d415667ff' + ), + WrapperSet: new LogEvent<([synthMarketId: bigint, wrapCollateralType: string, maxWrappableAmount: bigint] & {synthMarketId: bigint, wrapCollateralType: string, maxWrappableAmount: bigint})>( + abi, '0xf6b8d296783aecfc5d372dff3e3e802ab63338637f9a2f3e2aae1e745c148def' + ), + AsyncFixedFeeSet: new LogEvent<([synthMarketId: bigint, asyncFixedFee: bigint] & {synthMarketId: bigint, asyncFixedFee: bigint})>( + abi, '0xaef59d229d195c5b8372221acbf4041b926fb1616a95f93e44379e4f30d57bfe' + ), + AtomicFixedFeeSet: new LogEvent<([synthMarketId: bigint, atomicFixedFee: bigint] & {synthMarketId: bigint, atomicFixedFee: bigint})>( + abi, '0x6b0a526b06b2f30ba2d5b063c2ef81547512216d37c540b86039e3a19f1d2b3f' + ), + CollateralLeverageSet: new LogEvent<([synthMarketId: bigint, collateralLeverage: bigint] & {synthMarketId: bigint, collateralLeverage: bigint})>( + abi, '0x83113c0e8d811f7e7017948357e945a1a8a6b6fc0d76c8512ffdd6f6766e8a13' + ), + FeeCollectorSet: new LogEvent<([synthMarketId: bigint, feeCollector: string] & {synthMarketId: bigint, feeCollector: string})>( + abi, '0x9559a9b7e14bf53553c17859be245a108350185ec859ec690012b13b820b7ef4' + ), + MarketSkewScaleSet: new LogEvent<([synthMarketId: bigint, skewScale: bigint] & {synthMarketId: bigint, skewScale: bigint})>( + abi, '0x786fdfd5a0e146d8f4878876a8439ff01436e5969b14682e12d07d7e926b157c' + ), + MarketUtilizationFeesSet: new LogEvent<([synthMarketId: bigint, utilizationFeeRate: bigint] & {synthMarketId: bigint, utilizationFeeRate: bigint})>( + abi, '0x83dfad56ac61e49feb43345b8c73b6d45eb121decc66b1709ca0413b31c64f63' + ), + ReferrerShareUpdated: new LogEvent<([marketId: bigint, referrer: string, sharePercentage: bigint] & {marketId: bigint, referrer: string, sharePercentage: bigint})>( + abi, '0xd2a3339bb3c610e9030023c1cb3e89374fe0ebd7e37faee9b3d343f33e9df2fb' + ), + TransactorFixedFeeSet: new LogEvent<([synthMarketId: bigint, transactor: string, fixedFeeAmount: bigint] & {synthMarketId: bigint, transactor: string, fixedFeeAmount: bigint})>( + abi, '0xeed7c7ebc4a7e7456a5b14f961bbe55d026f35a2a2b52d1ad43fe11c348df24a' + ), + WrapperFeesSet: new LogEvent<([synthMarketId: bigint, wrapFee: bigint, unwrapFee: bigint] & {synthMarketId: bigint, wrapFee: bigint, unwrapFee: bigint})>( + abi, '0x84c5bc20d6e52e92afe6ebc9d85d3e4d35de276ba3f05cae640db053f5b861b8' + ), + FeatureFlagAllowAllSet: new LogEvent<([feature: string, allowAll: boolean] & {feature: string, allowAll: boolean})>( + abi, '0xa806035d8c8de7cd43725250d3fbf9ee7abe3b99ffb892897913d8a21721121d' + ), + FeatureFlagAllowlistAdded: new LogEvent<([feature: string, account: string] & {feature: string, account: string})>( + abi, '0x30b9b4104e2fb00b4f980e414dcd828e691c8fcb286f0c73d7267c3a2de49383' + ), + FeatureFlagAllowlistRemoved: new LogEvent<([feature: string, account: string] & {feature: string, account: string})>( + abi, '0xb44a47e11880cc865e8ea382561e406dea8c895366c58e3908f05708b2880890' + ), + FeatureFlagDeniersReset: new LogEvent<([feature: string, deniers: Array] & {feature: string, deniers: Array})>( + abi, '0x74d48d0b51a70680130c00decd06b4d536fbb3cee16a3b0bdd2309c264dcbd13' + ), + FeatureFlagDenyAllSet: new LogEvent<([feature: string, denyAll: boolean] & {feature: string, denyAll: boolean})>( + abi, '0x97f76d2e384948e28ddd4280a4e76e8600acc328a0c0910c93682a0fccc02018' + ), +} + +export const functions = { + acceptOwnership: new Func<[], {}, []>( + abi, '0x79ba5097' + ), + getImplementation: new Func<[], {}, string>( + abi, '0xaaf10f42' + ), + nominateNewOwner: new Func<[newNominatedOwner: string], {newNominatedOwner: string}, []>( + abi, '0x1627540c' + ), + nominatedOwner: new Func<[], {}, string>( + abi, '0x53a47bb7' + ), + owner: new Func<[], {}, string>( + abi, '0x8da5cb5b' + ), + renounceNomination: new Func<[], {}, []>( + abi, '0x718fe928' + ), + simulateUpgradeTo: new Func<[newImplementation: string], {newImplementation: string}, []>( + abi, '0xc7f62cda' + ), + upgradeTo: new Func<[newImplementation: string], {newImplementation: string}, []>( + abi, '0x3659cfe6' + ), + acceptMarketOwnership: new Func<[synthMarketId: bigint], {synthMarketId: bigint}, []>( + abi, '0x1c216a0e' + ), + createSynth: new Func<[tokenName: string, tokenSymbol: string, synthOwner: string], {tokenName: string, tokenSymbol: string, synthOwner: string}, bigint>( + abi, '0x2e535d61' + ), + getAssociatedSystem: new Func<[id: string], {id: string}, ([addr: string, kind: string] & {addr: string, kind: string})>( + abi, '0x60988e09' + ), + getMarketOwner: new Func<[synthMarketId: bigint], {synthMarketId: bigint}, string>( + abi, '0xa7b8cb9f' + ), + getNominatedMarketOwner: new Func<[synthMarketId: bigint], {synthMarketId: bigint}, string>( + abi, '0xd2a25290' + ), + getPriceData: new Func<[synthMarketId: bigint], {synthMarketId: bigint}, ([buyFeedId: string, sellFeedId: string, strictPriceStalenessTolerance: bigint] & {buyFeedId: string, sellFeedId: string, strictPriceStalenessTolerance: bigint})>( + abi, '0x462b9a2d' + ), + getSynth: new Func<[marketId: bigint], {marketId: bigint}, string>( + abi, '0x69e0365f' + ), + getSynthImpl: new Func<[marketId: bigint], {marketId: bigint}, string>( + abi, '0x3e0c76ca' + ), + initOrUpgradeNft: new Func<[id: string, name: string, symbol: string, uri: string, impl: string], {id: string, name: string, symbol: string, uri: string, impl: string}, []>( + abi, '0x2d22bef9' + ), + initOrUpgradeToken: new Func<[id: string, name: string, symbol: string, decimals: number, impl: string], {id: string, name: string, symbol: string, decimals: number, impl: string}, []>( + abi, '0xc6f79537' + ), + minimumCredit: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0xafe79200' + ), + name: new Func<[marketId: bigint], {marketId: bigint}, string>( + abi, '0xc624440a' + ), + nominateMarketOwner: new Func<[synthMarketId: bigint, newNominatedOwner: string], {synthMarketId: bigint, newNominatedOwner: string}, []>( + abi, '0x5950864b' + ), + registerUnmanagedSystem: new Func<[id: string, endpoint: string], {id: string, endpoint: string}, []>( + abi, '0xd245d983' + ), + renounceMarketNomination: new Func<[synthMarketId: bigint], {synthMarketId: bigint}, []>( + abi, '0x298b26bf' + ), + renounceMarketOwnership: new Func<[synthMarketId: bigint], {synthMarketId: bigint}, []>( + abi, '0xbd1cdfb5' + ), + reportedDebt: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0xbcec0d0f' + ), + setDecayRate: new Func<[marketId: bigint, rate: bigint], {marketId: bigint, rate: bigint}, []>( + abi, '0xec846bac' + ), + setSynthImplementation: new Func<[synthImplementation: string], {synthImplementation: string}, []>( + abi, '0xec04ceb1' + ), + setSynthetix: new Func<[synthetix: string], {synthetix: string}, []>( + abi, '0xfec9f9da' + ), + supportsInterface: new Func<[interfaceId: string], {interfaceId: string}, boolean>( + abi, '0x01ffc9a7' + ), + updatePriceData: new Func<[synthMarketId: bigint, buyFeedId: string, sellFeedId: string, strictPriceStalenessTolerance: bigint], {synthMarketId: bigint, buyFeedId: string, sellFeedId: string, strictPriceStalenessTolerance: bigint}, []>( + abi, '0x911414c6' + ), + upgradeSynthImpl: new Func<[marketId: bigint], {marketId: bigint}, []>( + abi, '0xc99d0cdd' + ), + buy: new Func<[marketId: bigint, usdAmount: bigint, minAmountReceived: bigint, referrer: string], {marketId: bigint, usdAmount: bigint, minAmountReceived: bigint, referrer: string}, ([synthAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {synthAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0x37fb3369' + ), + buyExactIn: new Func<[marketId: bigint, usdAmount: bigint, minAmountReceived: bigint, referrer: string], {marketId: bigint, usdAmount: bigint, minAmountReceived: bigint, referrer: string}, ([synthAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {synthAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0xa12d9400' + ), + buyExactOut: new Func<[marketId: bigint, synthAmount: bigint, maxUsdAmount: bigint, referrer: string], {marketId: bigint, synthAmount: bigint, maxUsdAmount: bigint, referrer: string}, ([usdAmountCharged: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {usdAmountCharged: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0x983220bb' + ), + getMarketSkew: new Func<[marketId: bigint], {marketId: bigint}, bigint>( + abi, '0xa05ee4f6' + ), + quoteBuyExactIn: new Func<[marketId: bigint, usdAmount: bigint, stalenessTolerance: number], {marketId: bigint, usdAmount: bigint, stalenessTolerance: number}, ([synthAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {synthAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0xab75d950' + ), + quoteBuyExactOut: new Func<[marketId: bigint, synthAmount: bigint, stalenessTolerance: number], {marketId: bigint, synthAmount: bigint, stalenessTolerance: number}, ([usdAmountCharged: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {usdAmountCharged: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0x70d9a0c6' + ), + quoteSellExactIn: new Func<[marketId: bigint, synthAmount: bigint, stalenessTolerance: number], {marketId: bigint, synthAmount: bigint, stalenessTolerance: number}, ([returnAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {returnAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0x687ed93d' + ), + quoteSellExactOut: new Func<[marketId: bigint, usdAmount: bigint, stalenessTolerance: number], {marketId: bigint, usdAmount: bigint, stalenessTolerance: number}, ([synthToBurn: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {synthToBurn: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0xc4b41a2e' + ), + sell: new Func<[marketId: bigint, synthAmount: bigint, minUsdAmount: bigint, referrer: string], {marketId: bigint, synthAmount: bigint, minUsdAmount: bigint, referrer: string}, ([usdAmountReceived: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {usdAmountReceived: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0x4d4bfbd5' + ), + sellExactIn: new Func<[marketId: bigint, synthAmount: bigint, minAmountReceived: bigint, referrer: string], {marketId: bigint, synthAmount: bigint, minAmountReceived: bigint, referrer: string}, ([returnAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {returnAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0x3d1a60e4' + ), + sellExactOut: new Func<[marketId: bigint, usdAmount: bigint, maxSynthAmount: bigint, referrer: string], {marketId: bigint, usdAmount: bigint, maxSynthAmount: bigint, referrer: string}, ([synthToBurn: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {synthToBurn: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0x4ce94d9d' + ), + cancelOrder: new Func<[marketId: bigint, asyncOrderId: bigint], {marketId: bigint, asyncOrderId: bigint}, []>( + abi, '0x4138dc53' + ), + commitOrder: new Func<[marketId: bigint, orderType: number, amountProvided: bigint, settlementStrategyId: bigint, minimumSettlementAmount: bigint, referrer: string], {marketId: bigint, orderType: number, amountProvided: bigint, settlementStrategyId: bigint, minimumSettlementAmount: bigint, referrer: string}, ([id: bigint, owner: string, orderType: number, amountEscrowed: bigint, settlementStrategyId: bigint, commitmentTime: bigint, minimumSettlementAmount: bigint, settledAt: bigint, referrer: string] & {id: bigint, owner: string, orderType: number, amountEscrowed: bigint, settlementStrategyId: bigint, commitmentTime: bigint, minimumSettlementAmount: bigint, settledAt: bigint, referrer: string})>( + abi, '0xd393340e' + ), + getAsyncOrderClaim: new Func<[marketId: bigint, asyncOrderId: bigint], {marketId: bigint, asyncOrderId: bigint}, ([id: bigint, owner: string, orderType: number, amountEscrowed: bigint, settlementStrategyId: bigint, commitmentTime: bigint, minimumSettlementAmount: bigint, settledAt: bigint, referrer: string] & {id: bigint, owner: string, orderType: number, amountEscrowed: bigint, settlementStrategyId: bigint, commitmentTime: bigint, minimumSettlementAmount: bigint, settledAt: bigint, referrer: string})>( + abi, '0x5381ce16' + ), + settleOrder: new Func<[marketId: bigint, asyncOrderId: bigint], {marketId: bigint, asyncOrderId: bigint}, ([finalOrderAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {finalOrderAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0x9444ac48' + ), + addSettlementStrategy: new Func<[marketId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean})], {marketId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean})}, bigint>( + abi, '0x97b30e6d' + ), + getSettlementStrategy: new Func<[marketId: bigint, strategyId: bigint], {marketId: bigint, strategyId: bigint}, ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean})>( + abi, '0xf74c377f' + ), + setSettlementStrategy: new Func<[marketId: bigint, strategyId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean})], {marketId: bigint, strategyId: bigint, strategy: ([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean})}, []>( + abi, '0x7cbe2075' + ), + setSettlementStrategyEnabled: new Func<[marketId: bigint, strategyId: bigint, enabled: boolean], {marketId: bigint, strategyId: bigint, enabled: boolean}, []>( + abi, '0x7f73a891' + ), + getWrapper: new Func<[marketId: bigint], {marketId: bigint}, ([wrapCollateralType: string, maxWrappableAmount: bigint] & {wrapCollateralType: string, maxWrappableAmount: bigint})>( + abi, '0x5fdf4e98' + ), + setWrapper: new Func<[marketId: bigint, wrapCollateralType: string, maxWrappableAmount: bigint], {marketId: bigint, wrapCollateralType: string, maxWrappableAmount: bigint}, []>( + abi, '0x673a21e5' + ), + unwrap: new Func<[marketId: bigint, unwrapAmount: bigint, minAmountReceived: bigint], {marketId: bigint, unwrapAmount: bigint, minAmountReceived: bigint}, ([returnCollateralAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {returnCollateralAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0x784dad9e' + ), + wrap: new Func<[marketId: bigint, wrapAmount: bigint, minAmountReceived: bigint], {marketId: bigint, wrapAmount: bigint, minAmountReceived: bigint}, ([amountToMint: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {amountToMint: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})>( + abi, '0xd7ce770c' + ), + getCollateralLeverage: new Func<[synthMarketId: bigint], {synthMarketId: bigint}, bigint>( + abi, '0xcdfaef0f' + ), + getCustomTransactorFees: new Func<[synthMarketId: bigint, transactor: string], {synthMarketId: bigint, transactor: string}, bigint>( + abi, '0x2efaa971' + ), + getFeeCollector: new Func<[synthMarketId: bigint], {synthMarketId: bigint}, string>( + abi, '0x5497eb23' + ), + getMarketFees: new Func<[synthMarketId: bigint], {synthMarketId: bigint}, ([atomicFixedFee: bigint, asyncFixedFee: bigint, wrapFee: bigint, unwrapFee: bigint] & {atomicFixedFee: bigint, asyncFixedFee: bigint, wrapFee: bigint, unwrapFee: bigint})>( + abi, '0x32598e61' + ), + getMarketSkewScale: new Func<[synthMarketId: bigint], {synthMarketId: bigint}, bigint>( + abi, '0x8d105571' + ), + getMarketUtilizationFees: new Func<[synthMarketId: bigint], {synthMarketId: bigint}, bigint>( + abi, '0xf375f324' + ), + getReferrerShare: new Func<[synthMarketId: bigint, referrer: string], {synthMarketId: bigint, referrer: string}, bigint>( + abi, '0xfa4b28ed' + ), + setAsyncFixedFee: new Func<[synthMarketId: bigint, asyncFixedFee: bigint], {synthMarketId: bigint, asyncFixedFee: bigint}, []>( + abi, '0x61dcca86' + ), + setAtomicFixedFee: new Func<[synthMarketId: bigint, atomicFixedFee: bigint], {synthMarketId: bigint, atomicFixedFee: bigint}, []>( + abi, '0x480be91f' + ), + setCollateralLeverage: new Func<[synthMarketId: bigint, collateralLeverage: bigint], {synthMarketId: bigint, collateralLeverage: bigint}, []>( + abi, '0x21f7f58f' + ), + setCustomTransactorFees: new Func<[synthMarketId: bigint, transactor: string, fixedFeeAmount: bigint], {synthMarketId: bigint, transactor: string, fixedFeeAmount: bigint}, []>( + abi, '0x95fcd547' + ), + setFeeCollector: new Func<[synthMarketId: bigint, feeCollector: string], {synthMarketId: bigint, feeCollector: string}, []>( + abi, '0x025f6120' + ), + setMarketSkewScale: new Func<[synthMarketId: bigint, skewScale: bigint], {synthMarketId: bigint, skewScale: bigint}, []>( + abi, '0x9a40f8cb' + ), + setMarketUtilizationFees: new Func<[synthMarketId: bigint, utilizationFeeRate: bigint], {synthMarketId: bigint, utilizationFeeRate: bigint}, []>( + abi, '0x45f2601c' + ), + setWrapperFees: new Func<[synthMarketId: bigint, wrapFee: bigint, unwrapFee: bigint], {synthMarketId: bigint, wrapFee: bigint, unwrapFee: bigint}, []>( + abi, '0x6539b1c3' + ), + updateReferrerShare: new Func<[synthMarketId: bigint, referrer: string, sharePercentage: bigint], {synthMarketId: bigint, referrer: string, sharePercentage: bigint}, []>( + abi, '0x6ad77077' + ), + addToFeatureFlagAllowlist: new Func<[feature: string, account: string], {feature: string, account: string}, []>( + abi, '0xa0778144' + ), + getDeniers: new Func<[feature: string], {feature: string}, Array>( + abi, '0xed429cf7' + ), + getFeatureFlagAllowAll: new Func<[feature: string], {feature: string}, boolean>( + abi, '0x40a399ef' + ), + getFeatureFlagAllowlist: new Func<[feature: string], {feature: string}, Array>( + abi, '0xe12c8160' + ), + getFeatureFlagDenyAll: new Func<[feature: string], {feature: string}, boolean>( + abi, '0xbcae3ea0' + ), + isFeatureAllowed: new Func<[feature: string, account: string], {feature: string, account: string}, boolean>( + abi, '0xcf635949' + ), + removeFromFeatureFlagAllowlist: new Func<[feature: string, account: string], {feature: string, account: string}, []>( + abi, '0xb7746b59' + ), + setDeniers: new Func<[feature: string, deniers: Array], {feature: string, deniers: Array}, []>( + abi, '0x715cb7d2' + ), + setFeatureFlagAllowAll: new Func<[feature: string, allowAll: boolean], {feature: string, allowAll: boolean}, []>( + abi, '0x7d632bd2' + ), + setFeatureFlagDenyAll: new Func<[feature: string, denyAll: boolean], {feature: string, denyAll: boolean}, []>( + abi, '0x5e52ad6e' + ), +} + +export class Contract extends ContractBase { + + getImplementation(): Promise { + return this.eth_call(functions.getImplementation, []) + } + + nominatedOwner(): Promise { + return this.eth_call(functions.nominatedOwner, []) + } + + owner(): Promise { + return this.eth_call(functions.owner, []) + } + + getAssociatedSystem(id: string): Promise<([addr: string, kind: string] & {addr: string, kind: string})> { + return this.eth_call(functions.getAssociatedSystem, [id]) + } + + getMarketOwner(synthMarketId: bigint): Promise { + return this.eth_call(functions.getMarketOwner, [synthMarketId]) + } + + getNominatedMarketOwner(synthMarketId: bigint): Promise { + return this.eth_call(functions.getNominatedMarketOwner, [synthMarketId]) + } + + getPriceData(synthMarketId: bigint): Promise<([buyFeedId: string, sellFeedId: string, strictPriceStalenessTolerance: bigint] & {buyFeedId: string, sellFeedId: string, strictPriceStalenessTolerance: bigint})> { + return this.eth_call(functions.getPriceData, [synthMarketId]) + } + + getSynth(marketId: bigint): Promise { + return this.eth_call(functions.getSynth, [marketId]) + } + + getSynthImpl(marketId: bigint): Promise { + return this.eth_call(functions.getSynthImpl, [marketId]) + } + + minimumCredit(marketId: bigint): Promise { + return this.eth_call(functions.minimumCredit, [marketId]) + } + + name(marketId: bigint): Promise { + return this.eth_call(functions.name, [marketId]) + } + + reportedDebt(marketId: bigint): Promise { + return this.eth_call(functions.reportedDebt, [marketId]) + } + + supportsInterface(interfaceId: string): Promise { + return this.eth_call(functions.supportsInterface, [interfaceId]) + } + + getMarketSkew(marketId: bigint): Promise { + return this.eth_call(functions.getMarketSkew, [marketId]) + } + + quoteBuyExactIn(marketId: bigint, usdAmount: bigint, stalenessTolerance: number): Promise<([synthAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {synthAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})> { + return this.eth_call(functions.quoteBuyExactIn, [marketId, usdAmount, stalenessTolerance]) + } + + quoteBuyExactOut(marketId: bigint, synthAmount: bigint, stalenessTolerance: number): Promise<([usdAmountCharged: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {usdAmountCharged: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})> { + return this.eth_call(functions.quoteBuyExactOut, [marketId, synthAmount, stalenessTolerance]) + } + + quoteSellExactIn(marketId: bigint, synthAmount: bigint, stalenessTolerance: number): Promise<([returnAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {returnAmount: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})> { + return this.eth_call(functions.quoteSellExactIn, [marketId, synthAmount, stalenessTolerance]) + } + + quoteSellExactOut(marketId: bigint, usdAmount: bigint, stalenessTolerance: number): Promise<([synthToBurn: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})] & {synthToBurn: bigint, fees: ([fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint] & {fixedFees: bigint, utilizationFees: bigint, skewFees: bigint, wrapperFees: bigint})})> { + return this.eth_call(functions.quoteSellExactOut, [marketId, usdAmount, stalenessTolerance]) + } + + getAsyncOrderClaim(marketId: bigint, asyncOrderId: bigint): Promise<([id: bigint, owner: string, orderType: number, amountEscrowed: bigint, settlementStrategyId: bigint, commitmentTime: bigint, minimumSettlementAmount: bigint, settledAt: bigint, referrer: string] & {id: bigint, owner: string, orderType: number, amountEscrowed: bigint, settlementStrategyId: bigint, commitmentTime: bigint, minimumSettlementAmount: bigint, settledAt: bigint, referrer: string})> { + return this.eth_call(functions.getAsyncOrderClaim, [marketId, asyncOrderId]) + } + + getSettlementStrategy(marketId: bigint, strategyId: bigint): Promise<([strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean] & {strategyType: number, settlementDelay: bigint, settlementWindowDuration: bigint, priceVerificationContract: string, feedId: string, url: string, settlementReward: bigint, priceDeviationTolerance: bigint, minimumUsdExchangeAmount: bigint, maxRoundingLoss: bigint, disabled: boolean})> { + return this.eth_call(functions.getSettlementStrategy, [marketId, strategyId]) + } + + getWrapper(marketId: bigint): Promise<([wrapCollateralType: string, maxWrappableAmount: bigint] & {wrapCollateralType: string, maxWrappableAmount: bigint})> { + return this.eth_call(functions.getWrapper, [marketId]) + } + + getCollateralLeverage(synthMarketId: bigint): Promise { + return this.eth_call(functions.getCollateralLeverage, [synthMarketId]) + } + + getCustomTransactorFees(synthMarketId: bigint, transactor: string): Promise { + return this.eth_call(functions.getCustomTransactorFees, [synthMarketId, transactor]) + } + + getFeeCollector(synthMarketId: bigint): Promise { + return this.eth_call(functions.getFeeCollector, [synthMarketId]) + } + + getMarketFees(synthMarketId: bigint): Promise<([atomicFixedFee: bigint, asyncFixedFee: bigint, wrapFee: bigint, unwrapFee: bigint] & {atomicFixedFee: bigint, asyncFixedFee: bigint, wrapFee: bigint, unwrapFee: bigint})> { + return this.eth_call(functions.getMarketFees, [synthMarketId]) + } + + getMarketSkewScale(synthMarketId: bigint): Promise { + return this.eth_call(functions.getMarketSkewScale, [synthMarketId]) + } + + getMarketUtilizationFees(synthMarketId: bigint): Promise { + return this.eth_call(functions.getMarketUtilizationFees, [synthMarketId]) + } + + getReferrerShare(synthMarketId: bigint, referrer: string): Promise { + return this.eth_call(functions.getReferrerShare, [synthMarketId, referrer]) + } + + getDeniers(feature: string): Promise> { + return this.eth_call(functions.getDeniers, [feature]) + } + + getFeatureFlagAllowAll(feature: string): Promise { + return this.eth_call(functions.getFeatureFlagAllowAll, [feature]) + } + + getFeatureFlagAllowlist(feature: string): Promise> { + return this.eth_call(functions.getFeatureFlagAllowlist, [feature]) + } + + getFeatureFlagDenyAll(feature: string): Promise { + return this.eth_call(functions.getFeatureFlagDenyAll, [feature]) + } + + isFeatureAllowed(feature: string, account: string): Promise { + return this.eth_call(functions.isFeatureAllowed, [feature, account]) + } +} diff --git a/indexers/arbitrum-sepolia/src/abi/abi.support.ts b/indexers/arbitrum-sepolia/src/abi/abi.support.ts new file mode 100644 index 00000000..c9cb14fa --- /dev/null +++ b/indexers/arbitrum-sepolia/src/abi/abi.support.ts @@ -0,0 +1,120 @@ +import assert from 'assert' +import * as ethers from 'ethers' + + +export interface LogRecord { + topics: string[] + data: string +} + + +export class LogEvent { + private fragment: ethers.EventFragment + + constructor(private abi: ethers.Interface, public readonly topic: string) { + let fragment = abi.getEvent(topic) + assert(fragment != null, 'Missing fragment') + this.fragment = fragment + } + + decode(rec: LogRecord): Args { + return this.abi.decodeEventLog(this.fragment, rec.data, rec.topics) as any as Args + } +} + + +export class Func { + private fragment: ethers.FunctionFragment + + constructor(private abi: ethers.Interface, public readonly sighash: string) { + let fragment = abi.getFunction(sighash) + assert(fragment != null, 'Missing fragment') + this.fragment = fragment + } + + decode(input: ethers.BytesLike): Args & FieldArgs { + return this.abi.decodeFunctionData(this.fragment, input) as any as Args & FieldArgs + } + + encode(args: Args): string { + return this.abi.encodeFunctionData(this.fragment, args) + } + + decodeResult(output: ethers.BytesLike): Result { + const decoded = this.abi.decodeFunctionResult(this.fragment, output) + return decoded.length > 1 ? decoded : decoded[0] + } + + tryDecodeResult(output: ethers.BytesLike): Result | undefined { + try { + return this.decodeResult(output) + } catch(err: any) { + return undefined + } + } +} + + +export function isFunctionResultDecodingError(val: unknown): val is Error & {data: string} { + if (!(val instanceof Error)) return false + let err = val as any + return err.code == 'CALL_EXCEPTION' + && typeof err.data == 'string' + && !err.errorArgs + && !err.errorName +} + + +export interface ChainContext { + _chain: Chain +} + + +export interface BlockContext { + _chain: Chain + block: Block +} + + +export interface Block { + height: number +} + + +export interface Chain { + client: { + call: (method: string, params?: unknown[]) => Promise + } +} + + +export class ContractBase { + private readonly _chain: Chain + private readonly blockHeight: number + readonly address: string + + constructor(ctx: BlockContext, address: string) + constructor(ctx: ChainContext, block: Block, address: string) + constructor(ctx: BlockContext, blockOrAddress: Block | string, address?: string) { + this._chain = ctx._chain + if (typeof blockOrAddress === 'string') { + this.blockHeight = ctx.block.height + this.address = ethers.getAddress(blockOrAddress) + } else { + if (address == null) { + throw new Error('missing contract address') + } + this.blockHeight = blockOrAddress.height + this.address = ethers.getAddress(address) + } + } + + async eth_call(func: Func, args: Args): Promise { + let data = func.encode(args) + let result = await this._chain.client.call('eth_call', [ + {to: this.address, data}, + '0x'+this.blockHeight.toString(16) + ]) + return func.decodeResult(result) + } +} diff --git a/indexers/arbitrum-sepolia/src/db.ts b/indexers/arbitrum-sepolia/src/db.ts new file mode 100644 index 00000000..7a5fd3b7 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/db.ts @@ -0,0 +1,11 @@ +import {Store as Store_, Database} from '@subsquid/file-store' +import {LocalDest} from '@subsquid/file-store' +import * as tables from './table' + +export let db = new Database({ + tables, + dest: new LocalDest('/parquet-data-indexers/arbitrum_sepolia_processed'), + chunkSizeMb: 100, +}) + +export type Store = Store_ ? R : never> diff --git a/indexers/arbitrum-sepolia/src/main.ts b/indexers/arbitrum-sepolia/src/main.ts new file mode 100644 index 00000000..cd89d70d --- /dev/null +++ b/indexers/arbitrum-sepolia/src/main.ts @@ -0,0 +1,62 @@ +import {coreProxy, accountProxy, spotMarketProxy, perpsMarketProxy, perpsAccountProxy} from './mapping' +import {processor} from './processor' +import {db, Store} from './db' + +processor.run(db, async (ctx) => { + for (let block of ctx.blocks) { + ctx.store.Block.write({ + id: block.header.id, + number: block.header.height, + timestamp: new Date(block.header.timestamp), + }) + + for (let log of block.logs) { + if (log.address === '0x76490713314fcec173f44e99346f54c6e92a8e42') { + coreProxy.parseEvent(ctx, log) + } + if (log.address === '0x1b791d05e437c78039424749243f5a79e747525e') { + accountProxy.parseEvent(ctx, log) + } + if (log.address === '0x93d645c42a0ca3e08e9552367b8c454765fff041') { + spotMarketProxy.parseEvent(ctx, log) + } + if (log.address === '0xa73a7b754ec870b3738d0654ca75b7d0eebdb460') { + perpsMarketProxy.parseEvent(ctx, log) + } + if (log.address === '0xf3d4109eb4e7ec31f8eee5d9addad5f3c53a6c87') { + perpsAccountProxy.parseEvent(ctx, log) + } + } + + for (let transaction of block.transactions) { + if (transaction.to === '0x76490713314fcec173f44e99346f54c6e92a8e42') { + coreProxy.parseFunction(ctx, transaction) + } + if (transaction.to === '0x1b791d05e437c78039424749243f5a79e747525e') { + accountProxy.parseFunction(ctx, transaction) + } + if (transaction.to === '0x93d645c42a0ca3e08e9552367b8c454765fff041') { + spotMarketProxy.parseFunction(ctx, transaction) + } + if (transaction.to === '0xa73a7b754ec870b3738d0654ca75b7d0eebdb460') { + perpsMarketProxy.parseFunction(ctx, transaction) + } + if (transaction.to === '0xf3d4109eb4e7ec31f8eee5d9addad5f3c53a6c87') { + perpsAccountProxy.parseFunction(ctx, transaction) + } + + ctx.store.Transaction.write({ + id: transaction.id, + blockNumber: block.header.height, + blockTimestamp: new Date(block.header.timestamp), + hash: transaction.hash, + to: transaction.to, + from: transaction.from, + status: transaction.status, + }) + } + } + if (ctx.isHead === true) { + ctx.store.setForceFlush(true) + } +}) diff --git a/indexers/arbitrum-sepolia/src/mapping/accountProxy.ts b/indexers/arbitrum-sepolia/src/mapping/accountProxy.ts new file mode 100644 index 00000000..c5316399 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/mapping/accountProxy.ts @@ -0,0 +1,113 @@ +import {DataHandlerContext} from '@subsquid/evm-processor' +import {Store} from '../db' +import * as spec from '../abi/AccountProxy' +import {Log, Transaction} from '../processor' + +const address = '0x1b791d05e437c78039424749243f5a79e747525e' + + +export function parseEvent(ctx: DataHandlerContext, log: Log) { + try { + switch (log.topics[0]) { + case spec.events['OwnerChanged'].topic: { + let e = spec.events['OwnerChanged'].decode(log) + ctx.store.AccountProxyEventOwnerChanged.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OwnerChanged', + oldOwner: e[0], + newOwner: e[1], + }) + break + } + case spec.events['OwnerNominated'].topic: { + let e = spec.events['OwnerNominated'].decode(log) + ctx.store.AccountProxyEventOwnerNominated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OwnerNominated', + newOwner: e[0], + }) + break + } + case spec.events['Upgraded'].topic: { + let e = spec.events['Upgraded'].decode(log) + ctx.store.AccountProxyEventUpgraded.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'Upgraded', + self: e[0], + implementation: e[1], + }) + break + } + case spec.events['Approval'].topic: { + let e = spec.events['Approval'].decode(log) + ctx.store.AccountProxyEventApproval.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'Approval', + owner: e[0], + approved: e[1], + tokenId: e[2].toString(), + }) + break + } + case spec.events['ApprovalForAll'].topic: { + let e = spec.events['ApprovalForAll'].decode(log) + ctx.store.AccountProxyEventApprovalForAll.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'ApprovalForAll', + owner: e[0], + operator: e[1], + approved: e[2], + }) + break + } + case spec.events['Transfer'].topic: { + let e = spec.events['Transfer'].decode(log) + ctx.store.AccountProxyEventTransfer.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'Transfer', + from: e[0], + to: e[1], + tokenId: e[2].toString(), + }) + break + } + } + } + catch (error) { + ctx.log.error({error, blockNumber: log.block.height, blockHash: log.block.hash, address}, `Unable to decode event "${log.topics[0]}"`) + } +} + +export function parseFunction(ctx: DataHandlerContext, transaction: Transaction) { + try { + switch (transaction.input.slice(0, 10)) { + } + } + catch (error) { + ctx.log.error({error, blockNumber: transaction.block.height, blockHash: transaction.block.hash, address}, `Unable to decode function "${transaction.input.slice(0, 10)}"`) + } +} diff --git a/indexers/arbitrum-sepolia/src/mapping/coreProxy.ts b/indexers/arbitrum-sepolia/src/mapping/coreProxy.ts new file mode 100644 index 00000000..7dc2bde6 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/mapping/coreProxy.ts @@ -0,0 +1,841 @@ +import {DataHandlerContext} from '@subsquid/evm-processor' +import {toJSON} from '@subsquid/util-internal-json' +import {Store} from '../db' +import * as spec from '../abi/CoreProxy' +import {Log, Transaction} from '../processor' + +const address = '0x76490713314fcec173f44e99346f54c6e92a8e42' + + +export function parseEvent(ctx: DataHandlerContext, log: Log) { + try { + switch (log.topics[0]) { + case spec.events['OwnerChanged'].topic: { + let e = spec.events['OwnerChanged'].decode(log) + ctx.store.CoreProxyEventOwnerChanged.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OwnerChanged', + oldOwner: e[0], + newOwner: e[1], + }) + break + } + case spec.events['OwnerNominated'].topic: { + let e = spec.events['OwnerNominated'].decode(log) + ctx.store.CoreProxyEventOwnerNominated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OwnerNominated', + newOwner: e[0], + }) + break + } + case spec.events['Upgraded'].topic: { + let e = spec.events['Upgraded'].decode(log) + ctx.store.CoreProxyEventUpgraded.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'Upgraded', + self: e[0], + implementation: e[1], + }) + break + } + case spec.events['FeatureFlagAllowAllSet'].topic: { + let e = spec.events['FeatureFlagAllowAllSet'].decode(log) + ctx.store.CoreProxyEventFeatureFlagAllowAllSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagAllowAllSet', + feature: e[0], + allowAll: e[1], + }) + break + } + case spec.events['FeatureFlagAllowlistAdded'].topic: { + let e = spec.events['FeatureFlagAllowlistAdded'].decode(log) + ctx.store.CoreProxyEventFeatureFlagAllowlistAdded.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagAllowlistAdded', + feature: e[0], + account: e[1], + }) + break + } + case spec.events['FeatureFlagAllowlistRemoved'].topic: { + let e = spec.events['FeatureFlagAllowlistRemoved'].decode(log) + ctx.store.CoreProxyEventFeatureFlagAllowlistRemoved.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagAllowlistRemoved', + feature: e[0], + account: e[1], + }) + break + } + case spec.events['FeatureFlagDeniersReset'].topic: { + let e = spec.events['FeatureFlagDeniersReset'].decode(log) + ctx.store.CoreProxyEventFeatureFlagDeniersReset.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagDeniersReset', + feature: e[0], + deniers: toJSON(e[1]), + }) + break + } + case spec.events['FeatureFlagDenyAllSet'].topic: { + let e = spec.events['FeatureFlagDenyAllSet'].decode(log) + ctx.store.CoreProxyEventFeatureFlagDenyAllSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagDenyAllSet', + feature: e[0], + denyAll: e[1], + }) + break + } + case spec.events['AccountCreated'].topic: { + let e = spec.events['AccountCreated'].decode(log) + ctx.store.CoreProxyEventAccountCreated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'AccountCreated', + accountId: e[0].toString(), + owner: e[1], + }) + break + } + case spec.events['PermissionGranted'].topic: { + let e = spec.events['PermissionGranted'].decode(log) + ctx.store.CoreProxyEventPermissionGranted.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PermissionGranted', + accountId: e[0].toString(), + permission: e[1], + user: e[2], + sender: e[3], + }) + break + } + case spec.events['PermissionRevoked'].topic: { + let e = spec.events['PermissionRevoked'].decode(log) + ctx.store.CoreProxyEventPermissionRevoked.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PermissionRevoked', + accountId: e[0].toString(), + permission: e[1], + user: e[2], + sender: e[3], + }) + break + } + case spec.events['DebtAssociated'].topic: { + let e = spec.events['DebtAssociated'].decode(log) + ctx.store.CoreProxyEventDebtAssociated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'DebtAssociated', + marketId: e[0].toString(), + poolId: e[1].toString(), + collateralType: e[2], + accountId: e[3].toString(), + amount: e[4].toString(), + updatedDebt: e[5].toString(), + }) + break + } + case spec.events['AssociatedSystemSet'].topic: { + let e = spec.events['AssociatedSystemSet'].decode(log) + ctx.store.CoreProxyEventAssociatedSystemSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'AssociatedSystemSet', + kind: e[0], + id0: e[1], + proxy: e[2], + impl: e[3], + }) + break + } + case spec.events['CollateralLockCreated'].topic: { + let e = spec.events['CollateralLockCreated'].decode(log) + ctx.store.CoreProxyEventCollateralLockCreated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'CollateralLockCreated', + accountId: e[0].toString(), + collateralType: e[1], + tokenAmount: e[2].toString(), + expireTimestamp: e[3].toString(), + }) + break + } + case spec.events['CollateralLockExpired'].topic: { + let e = spec.events['CollateralLockExpired'].decode(log) + ctx.store.CoreProxyEventCollateralLockExpired.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'CollateralLockExpired', + accountId: e[0].toString(), + collateralType: e[1], + tokenAmount: e[2].toString(), + expireTimestamp: e[3].toString(), + }) + break + } + case spec.events['Deposited'].topic: { + let e = spec.events['Deposited'].decode(log) + ctx.store.CoreProxyEventDeposited.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'Deposited', + accountId: e[0].toString(), + collateralType: e[1], + tokenAmount: e[2].toString(), + sender: e[3], + }) + break + } + case spec.events['Withdrawn'].topic: { + let e = spec.events['Withdrawn'].decode(log) + ctx.store.CoreProxyEventWithdrawn.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'Withdrawn', + accountId: e[0].toString(), + collateralType: e[1], + tokenAmount: e[2].toString(), + sender: e[3], + }) + break + } + case spec.events['CollateralConfigured'].topic: { + let e = spec.events['CollateralConfigured'].decode(log) + ctx.store.CoreProxyEventCollateralConfigured.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'CollateralConfigured', + collateralType: e[0], + config: toJSON(e[1]), + }) + break + } + case spec.events['TransferCrossChainInitiated'].topic: { + let e = spec.events['TransferCrossChainInitiated'].decode(log) + ctx.store.CoreProxyEventTransferCrossChainInitiated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'TransferCrossChainInitiated', + destChainId: e[0].toString(), + amount: e[1].toString(), + sender: e[2], + }) + break + } + case spec.events['IssuanceFeePaid'].topic: { + let e = spec.events['IssuanceFeePaid'].decode(log) + ctx.store.CoreProxyEventIssuanceFeePaid.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'IssuanceFeePaid', + accountId: e[0].toString(), + poolId: e[1].toString(), + collateralType: e[2], + feeAmount: e[3].toString(), + }) + break + } + case spec.events['UsdBurned'].topic: { + let e = spec.events['UsdBurned'].decode(log) + ctx.store.CoreProxyEventUsdBurned.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'UsdBurned', + accountId: e[0].toString(), + poolId: e[1].toString(), + collateralType: e[2], + amount: e[3].toString(), + sender: e[4], + }) + break + } + case spec.events['UsdMinted'].topic: { + let e = spec.events['UsdMinted'].decode(log) + ctx.store.CoreProxyEventUsdMinted.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'UsdMinted', + accountId: e[0].toString(), + poolId: e[1].toString(), + collateralType: e[2], + amount: e[3].toString(), + sender: e[4], + }) + break + } + case spec.events['Liquidation'].topic: { + let e = spec.events['Liquidation'].decode(log) + ctx.store.CoreProxyEventLiquidation.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'Liquidation', + accountId: e[0].toString(), + poolId: e[1].toString(), + collateralType: e[2], + liquidationData: toJSON(e[3]), + liquidateAsAccountId: e[4].toString(), + sender: e[5], + }) + break + } + case spec.events['VaultLiquidation'].topic: { + let e = spec.events['VaultLiquidation'].decode(log) + ctx.store.CoreProxyEventVaultLiquidation.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'VaultLiquidation', + poolId: e[0].toString(), + collateralType: e[1], + liquidationData: toJSON(e[2]), + liquidateAsAccountId: e[3].toString(), + sender: e[4], + }) + break + } + case spec.events['MarketCollateralDeposited'].topic: { + let e = spec.events['MarketCollateralDeposited'].decode(log) + ctx.store.CoreProxyEventMarketCollateralDeposited.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketCollateralDeposited', + marketId: e[0].toString(), + collateralType: e[1], + tokenAmount: e[2].toString(), + sender: e[3], + creditCapacity: e[4].toString(), + netIssuance: e[5].toString(), + depositedCollateralValue: e[6].toString(), + reportedDebt: e[7].toString(), + }) + break + } + case spec.events['MarketCollateralWithdrawn'].topic: { + let e = spec.events['MarketCollateralWithdrawn'].decode(log) + ctx.store.CoreProxyEventMarketCollateralWithdrawn.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketCollateralWithdrawn', + marketId: e[0].toString(), + collateralType: e[1], + tokenAmount: e[2].toString(), + sender: e[3], + creditCapacity: e[4].toString(), + netIssuance: e[5].toString(), + depositedCollateralValue: e[6].toString(), + reportedDebt: e[7].toString(), + }) + break + } + case spec.events['MaximumMarketCollateralConfigured'].topic: { + let e = spec.events['MaximumMarketCollateralConfigured'].decode(log) + ctx.store.CoreProxyEventMaximumMarketCollateralConfigured.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MaximumMarketCollateralConfigured', + marketId: e[0].toString(), + collateralType: e[1], + systemAmount: e[2].toString(), + owner: e[3], + }) + break + } + case spec.events['MarketRegistered'].topic: { + let e = spec.events['MarketRegistered'].decode(log) + ctx.store.CoreProxyEventMarketRegistered.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketRegistered', + market: e[0], + marketId: e[1].toString(), + sender: e[2], + }) + break + } + case spec.events['MarketSystemFeePaid'].topic: { + let e = spec.events['MarketSystemFeePaid'].decode(log) + ctx.store.CoreProxyEventMarketSystemFeePaid.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketSystemFeePaid', + marketId: e[0].toString(), + feeAmount: e[1].toString(), + }) + break + } + case spec.events['MarketUsdDeposited'].topic: { + let e = spec.events['MarketUsdDeposited'].decode(log) + ctx.store.CoreProxyEventMarketUsdDeposited.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketUsdDeposited', + marketId: e[0].toString(), + target: e[1], + amount: e[2].toString(), + market: e[3], + creditCapacity: e[4].toString(), + netIssuance: e[5].toString(), + depositedCollateralValue: e[6].toString(), + }) + break + } + case spec.events['MarketUsdWithdrawn'].topic: { + let e = spec.events['MarketUsdWithdrawn'].decode(log) + ctx.store.CoreProxyEventMarketUsdWithdrawn.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketUsdWithdrawn', + marketId: e[0].toString(), + target: e[1], + amount: e[2].toString(), + market: e[3], + creditCapacity: e[4].toString(), + netIssuance: e[5].toString(), + depositedCollateralValue: e[6].toString(), + }) + break + } + case spec.events['SetMarketMinLiquidityRatio'].topic: { + let e = spec.events['SetMarketMinLiquidityRatio'].decode(log) + ctx.store.CoreProxyEventSetMarketMinLiquidityRatio.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SetMarketMinLiquidityRatio', + marketId: e[0].toString(), + minLiquidityRatio: e[1].toString(), + }) + break + } + case spec.events['SetMinDelegateTime'].topic: { + let e = spec.events['SetMinDelegateTime'].decode(log) + ctx.store.CoreProxyEventSetMinDelegateTime.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SetMinDelegateTime', + marketId: e[0].toString(), + minDelegateTime: e[1], + }) + break + } + case spec.events['PoolApprovedAdded'].topic: { + let e = spec.events['PoolApprovedAdded'].decode(log) + ctx.store.CoreProxyEventPoolApprovedAdded.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PoolApprovedAdded', + poolId: e[0].toString(), + }) + break + } + case spec.events['PoolApprovedRemoved'].topic: { + let e = spec.events['PoolApprovedRemoved'].decode(log) + ctx.store.CoreProxyEventPoolApprovedRemoved.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PoolApprovedRemoved', + poolId: e[0].toString(), + }) + break + } + case spec.events['PreferredPoolSet'].topic: { + let e = spec.events['PreferredPoolSet'].decode(log) + ctx.store.CoreProxyEventPreferredPoolSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PreferredPoolSet', + poolId: e[0].toString(), + }) + break + } + case spec.events['PoolCollateralConfigurationUpdated'].topic: { + let e = spec.events['PoolCollateralConfigurationUpdated'].decode(log) + ctx.store.CoreProxyEventPoolCollateralConfigurationUpdated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PoolCollateralConfigurationUpdated', + poolId: e[0].toString(), + collateralType: e[1], + config: toJSON(e[2]), + }) + break + } + case spec.events['PoolCollateralDisabledByDefaultSet'].topic: { + let e = spec.events['PoolCollateralDisabledByDefaultSet'].decode(log) + ctx.store.CoreProxyEventPoolCollateralDisabledByDefaultSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PoolCollateralDisabledByDefaultSet', + poolId: e[0].toString(), + disabled: e[1], + }) + break + } + case spec.events['PoolConfigurationSet'].topic: { + let e = spec.events['PoolConfigurationSet'].decode(log) + ctx.store.CoreProxyEventPoolConfigurationSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PoolConfigurationSet', + poolId: e[0].toString(), + markets: toJSON(e[1]), + sender: e[2], + }) + break + } + case spec.events['PoolCreated'].topic: { + let e = spec.events['PoolCreated'].decode(log) + ctx.store.CoreProxyEventPoolCreated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PoolCreated', + poolId: e[0].toString(), + owner: e[1], + sender: e[2], + }) + break + } + case spec.events['PoolNameUpdated'].topic: { + let e = spec.events['PoolNameUpdated'].decode(log) + ctx.store.CoreProxyEventPoolNameUpdated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PoolNameUpdated', + poolId: e[0].toString(), + name: e[1], + sender: e[2], + }) + break + } + case spec.events['PoolNominationRenounced'].topic: { + let e = spec.events['PoolNominationRenounced'].decode(log) + ctx.store.CoreProxyEventPoolNominationRenounced.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PoolNominationRenounced', + poolId: e[0].toString(), + owner: e[1], + }) + break + } + case spec.events['PoolNominationRevoked'].topic: { + let e = spec.events['PoolNominationRevoked'].decode(log) + ctx.store.CoreProxyEventPoolNominationRevoked.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PoolNominationRevoked', + poolId: e[0].toString(), + owner: e[1], + }) + break + } + case spec.events['PoolOwnerNominated'].topic: { + let e = spec.events['PoolOwnerNominated'].decode(log) + ctx.store.CoreProxyEventPoolOwnerNominated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PoolOwnerNominated', + poolId: e[0].toString(), + nominatedOwner: e[1], + owner: e[2], + }) + break + } + case spec.events['PoolOwnershipAccepted'].topic: { + let e = spec.events['PoolOwnershipAccepted'].decode(log) + ctx.store.CoreProxyEventPoolOwnershipAccepted.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PoolOwnershipAccepted', + poolId: e[0].toString(), + owner: e[1], + }) + break + } + case spec.events['PoolOwnershipRenounced'].topic: { + let e = spec.events['PoolOwnershipRenounced'].decode(log) + ctx.store.CoreProxyEventPoolOwnershipRenounced.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PoolOwnershipRenounced', + poolId: e[0].toString(), + owner: e[1], + }) + break + } + case spec.events['SetMinLiquidityRatio'].topic: { + let e = spec.events['SetMinLiquidityRatio'].decode(log) + ctx.store.CoreProxyEventSetMinLiquidityRatio.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SetMinLiquidityRatio', + minLiquidityRatio: e[0].toString(), + }) + break + } + case spec.events['RewardsClaimed'].topic: { + let e = spec.events['RewardsClaimed'].decode(log) + ctx.store.CoreProxyEventRewardsClaimed.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'RewardsClaimed', + accountId: e[0].toString(), + poolId: e[1].toString(), + collateralType: e[2], + distributor: e[3], + amount: e[4].toString(), + }) + break + } + case spec.events['RewardsDistributed'].topic: { + let e = spec.events['RewardsDistributed'].decode(log) + ctx.store.CoreProxyEventRewardsDistributed.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'RewardsDistributed', + poolId: e[0].toString(), + collateralType: e[1], + distributor: e[2], + amount: e[3].toString(), + start: e[4].toString(), + duration: e[5].toString(), + }) + break + } + case spec.events['RewardsDistributorRegistered'].topic: { + let e = spec.events['RewardsDistributorRegistered'].decode(log) + ctx.store.CoreProxyEventRewardsDistributorRegistered.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'RewardsDistributorRegistered', + poolId: e[0].toString(), + collateralType: e[1], + distributor: e[2], + }) + break + } + case spec.events['RewardsDistributorRemoved'].topic: { + let e = spec.events['RewardsDistributorRemoved'].decode(log) + ctx.store.CoreProxyEventRewardsDistributorRemoved.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'RewardsDistributorRemoved', + poolId: e[0].toString(), + collateralType: e[1], + distributor: e[2], + }) + break + } + case spec.events['NewSupportedCrossChainNetwork'].topic: { + let e = spec.events['NewSupportedCrossChainNetwork'].decode(log) + ctx.store.CoreProxyEventNewSupportedCrossChainNetwork.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'NewSupportedCrossChainNetwork', + newChainId: e[0].toString(), + }) + break + } + case spec.events['DelegationUpdated'].topic: { + let e = spec.events['DelegationUpdated'].decode(log) + ctx.store.CoreProxyEventDelegationUpdated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'DelegationUpdated', + accountId: e[0].toString(), + poolId: e[1].toString(), + collateralType: e[2], + amount: e[3].toString(), + leverage: e[4].toString(), + sender: e[5], + }) + break + } + } + } + catch (error) { + ctx.log.error({error, blockNumber: log.block.height, blockHash: log.block.hash, address}, `Unable to decode event "${log.topics[0]}"`) + } +} + +export function parseFunction(ctx: DataHandlerContext, transaction: Transaction) { + try { + switch (transaction.input.slice(0, 10)) { + } + } + catch (error) { + ctx.log.error({error, blockNumber: transaction.block.height, blockHash: transaction.block.hash, address}, `Unable to decode function "${transaction.input.slice(0, 10)}"`) + } +} diff --git a/indexers/arbitrum-sepolia/src/mapping/index.ts b/indexers/arbitrum-sepolia/src/mapping/index.ts new file mode 100644 index 00000000..01b774db --- /dev/null +++ b/indexers/arbitrum-sepolia/src/mapping/index.ts @@ -0,0 +1,5 @@ +export * as coreProxy from './coreProxy' +export * as accountProxy from './accountProxy' +export * as spotMarketProxy from './spotMarketProxy' +export * as perpsMarketProxy from './perpsMarketProxy' +export * as perpsAccountProxy from './perpsAccountProxy' diff --git a/indexers/arbitrum-sepolia/src/mapping/perpsAccountProxy.ts b/indexers/arbitrum-sepolia/src/mapping/perpsAccountProxy.ts new file mode 100644 index 00000000..71bc22d9 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/mapping/perpsAccountProxy.ts @@ -0,0 +1,113 @@ +import {DataHandlerContext} from '@subsquid/evm-processor' +import {Store} from '../db' +import * as spec from '../abi/PerpsAccountProxy' +import {Log, Transaction} from '../processor' + +const address = '0xf3d4109eb4e7ec31f8eee5d9addad5f3c53a6c87' + + +export function parseEvent(ctx: DataHandlerContext, log: Log) { + try { + switch (log.topics[0]) { + case spec.events['OwnerChanged'].topic: { + let e = spec.events['OwnerChanged'].decode(log) + ctx.store.PerpsAccountProxyEventOwnerChanged.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OwnerChanged', + oldOwner: e[0], + newOwner: e[1], + }) + break + } + case spec.events['OwnerNominated'].topic: { + let e = spec.events['OwnerNominated'].decode(log) + ctx.store.PerpsAccountProxyEventOwnerNominated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OwnerNominated', + newOwner: e[0], + }) + break + } + case spec.events['Upgraded'].topic: { + let e = spec.events['Upgraded'].decode(log) + ctx.store.PerpsAccountProxyEventUpgraded.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'Upgraded', + self: e[0], + implementation: e[1], + }) + break + } + case spec.events['Approval'].topic: { + let e = spec.events['Approval'].decode(log) + ctx.store.PerpsAccountProxyEventApproval.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'Approval', + owner: e[0], + approved: e[1], + tokenId: e[2].toString(), + }) + break + } + case spec.events['ApprovalForAll'].topic: { + let e = spec.events['ApprovalForAll'].decode(log) + ctx.store.PerpsAccountProxyEventApprovalForAll.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'ApprovalForAll', + owner: e[0], + operator: e[1], + approved: e[2], + }) + break + } + case spec.events['Transfer'].topic: { + let e = spec.events['Transfer'].decode(log) + ctx.store.PerpsAccountProxyEventTransfer.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'Transfer', + from: e[0], + to: e[1], + tokenId: e[2].toString(), + }) + break + } + } + } + catch (error) { + ctx.log.error({error, blockNumber: log.block.height, blockHash: log.block.hash, address}, `Unable to decode event "${log.topics[0]}"`) + } +} + +export function parseFunction(ctx: DataHandlerContext, transaction: Transaction) { + try { + switch (transaction.input.slice(0, 10)) { + } + } + catch (error) { + ctx.log.error({error, blockNumber: transaction.block.height, blockHash: transaction.block.hash, address}, `Unable to decode function "${transaction.input.slice(0, 10)}"`) + } +} diff --git a/indexers/arbitrum-sepolia/src/mapping/perpsMarketProxy.ts b/indexers/arbitrum-sepolia/src/mapping/perpsMarketProxy.ts new file mode 100644 index 00000000..df57b5c4 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/mapping/perpsMarketProxy.ts @@ -0,0 +1,752 @@ +import {DataHandlerContext} from '@subsquid/evm-processor' +import {toJSON} from '@subsquid/util-internal-json' +import {Store} from '../db' +import * as spec from '../abi/PerpsMarketProxy' +import {Log, Transaction} from '../processor' + +const address = '0xa73a7b754ec870b3738d0654ca75b7d0eebdb460' + + +export function parseEvent(ctx: DataHandlerContext, log: Log) { + try { + switch (log.topics[0]) { + case spec.events['AccountCreated'].topic: { + let e = spec.events['AccountCreated'].decode(log) + ctx.store.PerpsMarketProxyEventAccountCreated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'AccountCreated', + accountId: e[0].toString(), + owner: e[1], + }) + break + } + case spec.events['PermissionGranted'].topic: { + let e = spec.events['PermissionGranted'].decode(log) + ctx.store.PerpsMarketProxyEventPermissionGranted.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PermissionGranted', + accountId: e[0].toString(), + permission: e[1], + user: e[2], + sender: e[3], + }) + break + } + case spec.events['PermissionRevoked'].topic: { + let e = spec.events['PermissionRevoked'].decode(log) + ctx.store.PerpsMarketProxyEventPermissionRevoked.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PermissionRevoked', + accountId: e[0].toString(), + permission: e[1], + user: e[2], + sender: e[3], + }) + break + } + case spec.events['AssociatedSystemSet'].topic: { + let e = spec.events['AssociatedSystemSet'].decode(log) + ctx.store.PerpsMarketProxyEventAssociatedSystemSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'AssociatedSystemSet', + kind: e[0], + id0: e[1], + proxy: e[2], + impl: e[3], + }) + break + } + case spec.events['OwnerChanged'].topic: { + let e = spec.events['OwnerChanged'].decode(log) + ctx.store.PerpsMarketProxyEventOwnerChanged.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OwnerChanged', + oldOwner: e[0], + newOwner: e[1], + }) + break + } + case spec.events['OwnerNominated'].topic: { + let e = spec.events['OwnerNominated'].decode(log) + ctx.store.PerpsMarketProxyEventOwnerNominated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OwnerNominated', + newOwner: e[0], + }) + break + } + case spec.events['Upgraded'].topic: { + let e = spec.events['Upgraded'].decode(log) + ctx.store.PerpsMarketProxyEventUpgraded.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'Upgraded', + self: e[0], + implementation: e[1], + }) + break + } + case spec.events['FactoryInitialized'].topic: { + let e = spec.events['FactoryInitialized'].decode(log) + ctx.store.PerpsMarketProxyEventFactoryInitialized.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FactoryInitialized', + globalPerpsMarketId: e[0].toString(), + }) + break + } + case spec.events['MarketCreated'].topic: { + let e = spec.events['MarketCreated'].decode(log) + ctx.store.PerpsMarketProxyEventMarketCreated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketCreated', + perpsMarketId: e[0].toString(), + marketName: e[1], + marketSymbol: e[2], + }) + break + } + case spec.events['CollateralModified'].topic: { + let e = spec.events['CollateralModified'].decode(log) + ctx.store.PerpsMarketProxyEventCollateralModified.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'CollateralModified', + accountId: e[0].toString(), + collateralId: e[1].toString(), + amountDelta: e[2].toString(), + sender: e[3], + }) + break + } + case spec.events['DebtPaid'].topic: { + let e = spec.events['DebtPaid'].decode(log) + ctx.store.PerpsMarketProxyEventDebtPaid.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'DebtPaid', + accountId: e[0].toString(), + amount: e[1].toString(), + sender: e[2], + }) + break + } + case spec.events['InterestRateUpdated'].topic: { + let e = spec.events['InterestRateUpdated'].decode(log) + ctx.store.PerpsMarketProxyEventInterestRateUpdated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'InterestRateUpdated', + superMarketId: e[0].toString(), + interestRate: e[1].toString(), + }) + break + } + case spec.events['OrderCommitted'].topic: { + let e = spec.events['OrderCommitted'].decode(log) + ctx.store.PerpsMarketProxyEventOrderCommitted.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OrderCommitted', + marketId: e[0].toString(), + accountId: e[1].toString(), + orderType: e[2], + sizeDelta: e[3].toString(), + acceptablePrice: e[4].toString(), + commitmentTime: e[5].toString(), + expectedPriceTime: e[6].toString(), + settlementTime: e[7].toString(), + expirationTime: e[8].toString(), + trackingCode: e[9], + sender: e[10], + }) + break + } + case spec.events['PreviousOrderExpired'].topic: { + let e = spec.events['PreviousOrderExpired'].decode(log) + ctx.store.PerpsMarketProxyEventPreviousOrderExpired.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PreviousOrderExpired', + marketId: e[0].toString(), + accountId: e[1].toString(), + sizeDelta: e[2].toString(), + acceptablePrice: e[3].toString(), + commitmentTime: e[4].toString(), + trackingCode: e[5], + }) + break + } + case spec.events['AccountCharged'].topic: { + let e = spec.events['AccountCharged'].decode(log) + ctx.store.PerpsMarketProxyEventAccountCharged.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'AccountCharged', + accountId: e[0].toString(), + amount: e[1].toString(), + accountDebt: e[2].toString(), + }) + break + } + case spec.events['InterestCharged'].topic: { + let e = spec.events['InterestCharged'].decode(log) + ctx.store.PerpsMarketProxyEventInterestCharged.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'InterestCharged', + accountId: e[0].toString(), + interest: e[1].toString(), + }) + break + } + case spec.events['MarketUpdated'].topic: { + let e = spec.events['MarketUpdated'].decode(log) + ctx.store.PerpsMarketProxyEventMarketUpdated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketUpdated', + marketId: e[0].toString(), + price: e[1].toString(), + skew: e[2].toString(), + size: e[3].toString(), + sizeDelta: e[4].toString(), + currentFundingRate: e[5].toString(), + currentFundingVelocity: e[6].toString(), + interestRate: e[7].toString(), + }) + break + } + case spec.events['OrderSettled'].topic: { + let e = spec.events['OrderSettled'].decode(log) + ctx.store.PerpsMarketProxyEventOrderSettled.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OrderSettled', + marketId: e[0].toString(), + accountId: e[1].toString(), + fillPrice: e[2].toString(), + pnl: e[3].toString(), + accruedFunding: e[4].toString(), + sizeDelta: e[5].toString(), + newSize: e[6].toString(), + totalFees: e[7].toString(), + referralFees: e[8].toString(), + collectedFees: e[9].toString(), + settlementReward: e[10].toString(), + trackingCode: e[11], + settler: e[12], + }) + break + } + case spec.events['OrderCancelled'].topic: { + let e = spec.events['OrderCancelled'].decode(log) + ctx.store.PerpsMarketProxyEventOrderCancelled.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OrderCancelled', + marketId: e[0].toString(), + accountId: e[1].toString(), + desiredPrice: e[2].toString(), + fillPrice: e[3].toString(), + sizeDelta: e[4].toString(), + settlementReward: e[5].toString(), + trackingCode: e[6], + settler: e[7], + }) + break + } + case spec.events['FeatureFlagAllowAllSet'].topic: { + let e = spec.events['FeatureFlagAllowAllSet'].decode(log) + ctx.store.PerpsMarketProxyEventFeatureFlagAllowAllSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagAllowAllSet', + feature: e[0], + allowAll: e[1], + }) + break + } + case spec.events['FeatureFlagAllowlistAdded'].topic: { + let e = spec.events['FeatureFlagAllowlistAdded'].decode(log) + ctx.store.PerpsMarketProxyEventFeatureFlagAllowlistAdded.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagAllowlistAdded', + feature: e[0], + account: e[1], + }) + break + } + case spec.events['FeatureFlagAllowlistRemoved'].topic: { + let e = spec.events['FeatureFlagAllowlistRemoved'].decode(log) + ctx.store.PerpsMarketProxyEventFeatureFlagAllowlistRemoved.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagAllowlistRemoved', + feature: e[0], + account: e[1], + }) + break + } + case spec.events['FeatureFlagDeniersReset'].topic: { + let e = spec.events['FeatureFlagDeniersReset'].decode(log) + ctx.store.PerpsMarketProxyEventFeatureFlagDeniersReset.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagDeniersReset', + feature: e[0], + deniers: toJSON(e[1]), + }) + break + } + case spec.events['FeatureFlagDenyAllSet'].topic: { + let e = spec.events['FeatureFlagDenyAllSet'].decode(log) + ctx.store.PerpsMarketProxyEventFeatureFlagDenyAllSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagDenyAllSet', + feature: e[0], + denyAll: e[1], + }) + break + } + case spec.events['AccountFlaggedForLiquidation'].topic: { + let e = spec.events['AccountFlaggedForLiquidation'].decode(log) + ctx.store.PerpsMarketProxyEventAccountFlaggedForLiquidation.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'AccountFlaggedForLiquidation', + accountId: e[0].toString(), + availableMargin: e[1].toString(), + requiredMaintenanceMargin: e[2].toString(), + liquidationReward: e[3].toString(), + flagReward: e[4].toString(), + }) + break + } + case spec.events['AccountLiquidationAttempt'].topic: { + let e = spec.events['AccountLiquidationAttempt'].decode(log) + ctx.store.PerpsMarketProxyEventAccountLiquidationAttempt.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'AccountLiquidationAttempt', + accountId: e[0].toString(), + reward: e[1].toString(), + fullLiquidation: e[2], + }) + break + } + case spec.events['AccountMarginLiquidation'].topic: { + let e = spec.events['AccountMarginLiquidation'].decode(log) + ctx.store.PerpsMarketProxyEventAccountMarginLiquidation.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'AccountMarginLiquidation', + accountId: e[0].toString(), + seizedMarginValue: e[1].toString(), + liquidationReward: e[2].toString(), + }) + break + } + case spec.events['PositionLiquidated'].topic: { + let e = spec.events['PositionLiquidated'].decode(log) + ctx.store.PerpsMarketProxyEventPositionLiquidated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PositionLiquidated', + accountId: e[0].toString(), + marketId: e[1].toString(), + amountLiquidated: e[2].toString(), + currentPositionSize: e[3].toString(), + }) + break + } + case spec.events['FundingParametersSet'].topic: { + let e = spec.events['FundingParametersSet'].decode(log) + ctx.store.PerpsMarketProxyEventFundingParametersSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FundingParametersSet', + marketId: e[0].toString(), + skewScale: e[1].toString(), + maxFundingVelocity: e[2].toString(), + }) + break + } + case spec.events['LiquidationParametersSet'].topic: { + let e = spec.events['LiquidationParametersSet'].decode(log) + ctx.store.PerpsMarketProxyEventLiquidationParametersSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'LiquidationParametersSet', + marketId: e[0].toString(), + initialMarginRatioD18: e[1].toString(), + maintenanceMarginRatioD18: e[2].toString(), + minimumInitialMarginRatioD18: e[3].toString(), + flagRewardRatioD18: e[4].toString(), + minimumPositionMargin: e[5].toString(), + }) + break + } + case spec.events['LockedOiRatioSet'].topic: { + let e = spec.events['LockedOiRatioSet'].decode(log) + ctx.store.PerpsMarketProxyEventLockedOiRatioSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'LockedOiRatioSet', + marketId: e[0].toString(), + lockedOiRatioD18: e[1].toString(), + }) + break + } + case spec.events['MarketPriceDataUpdated'].topic: { + let e = spec.events['MarketPriceDataUpdated'].decode(log) + ctx.store.PerpsMarketProxyEventMarketPriceDataUpdated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketPriceDataUpdated', + marketId: e[0].toString(), + feedId: e[1], + strictStalenessTolerance: e[2].toString(), + }) + break + } + case spec.events['MaxLiquidationParametersSet'].topic: { + let e = spec.events['MaxLiquidationParametersSet'].decode(log) + ctx.store.PerpsMarketProxyEventMaxLiquidationParametersSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MaxLiquidationParametersSet', + marketId: e[0].toString(), + maxLiquidationLimitAccumulationMultiplier: e[1].toString(), + maxSecondsInLiquidationWindow: e[2].toString(), + maxLiquidationPd: e[3].toString(), + endorsedLiquidator: e[4], + }) + break + } + case spec.events['MaxMarketSizeSet'].topic: { + let e = spec.events['MaxMarketSizeSet'].decode(log) + ctx.store.PerpsMarketProxyEventMaxMarketSizeSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MaxMarketSizeSet', + marketId: e[0].toString(), + maxMarketSize: e[1].toString(), + }) + break + } + case spec.events['MaxMarketValueSet'].topic: { + let e = spec.events['MaxMarketValueSet'].decode(log) + ctx.store.PerpsMarketProxyEventMaxMarketValueSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MaxMarketValueSet', + marketId: e[0].toString(), + maxMarketValue: e[1].toString(), + }) + break + } + case spec.events['OrderFeesSet'].topic: { + let e = spec.events['OrderFeesSet'].decode(log) + ctx.store.PerpsMarketProxyEventOrderFeesSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OrderFeesSet', + marketId: e[0].toString(), + makerFeeRatio: e[1].toString(), + takerFeeRatio: e[2].toString(), + }) + break + } + case spec.events['SettlementStrategyAdded'].topic: { + let e = spec.events['SettlementStrategyAdded'].decode(log) + ctx.store.PerpsMarketProxyEventSettlementStrategyAdded.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SettlementStrategyAdded', + marketId: e[0].toString(), + strategy: toJSON(e[1]), + strategyId: e[2].toString(), + }) + break + } + case spec.events['SettlementStrategySet'].topic: { + let e = spec.events['SettlementStrategySet'].decode(log) + ctx.store.PerpsMarketProxyEventSettlementStrategySet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SettlementStrategySet', + marketId: e[0].toString(), + strategyId: e[1].toString(), + strategy: toJSON(e[2]), + }) + break + } + case spec.events['CollateralConfigurationSet'].topic: { + let e = spec.events['CollateralConfigurationSet'].decode(log) + ctx.store.PerpsMarketProxyEventCollateralConfigurationSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'CollateralConfigurationSet', + collateralId: e[0].toString(), + maxCollateralAmount: e[1].toString(), + upperLimitDiscount: e[2].toString(), + lowerLimitDiscount: e[3].toString(), + discountScalar: e[4].toString(), + }) + break + } + case spec.events['CollateralLiquidateRewardRatioSet'].topic: { + let e = spec.events['CollateralLiquidateRewardRatioSet'].decode(log) + ctx.store.PerpsMarketProxyEventCollateralLiquidateRewardRatioSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'CollateralLiquidateRewardRatioSet', + collateralLiquidateRewardRatioD18: e[0].toString(), + }) + break + } + case spec.events['RewardDistributorRegistered'].topic: { + let e = spec.events['RewardDistributorRegistered'].decode(log) + ctx.store.PerpsMarketProxyEventRewardDistributorRegistered.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'RewardDistributorRegistered', + distributor: e[0], + }) + break + } + case spec.events['FeeCollectorSet'].topic: { + let e = spec.events['FeeCollectorSet'].decode(log) + ctx.store.PerpsMarketProxyEventFeeCollectorSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeeCollectorSet', + feeCollector: e[0], + }) + break + } + case spec.events['InterestRateParametersSet'].topic: { + let e = spec.events['InterestRateParametersSet'].decode(log) + ctx.store.PerpsMarketProxyEventInterestRateParametersSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'InterestRateParametersSet', + lowUtilizationInterestRateGradient: e[0].toString(), + interestRateGradientBreakpoint: e[1].toString(), + highUtilizationInterestRateGradient: e[2].toString(), + }) + break + } + case spec.events['KeeperCostNodeIdUpdated'].topic: { + let e = spec.events['KeeperCostNodeIdUpdated'].decode(log) + ctx.store.PerpsMarketProxyEventKeeperCostNodeIdUpdated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'KeeperCostNodeIdUpdated', + keeperCostNodeId: e[0], + }) + break + } + case spec.events['KeeperRewardGuardsSet'].topic: { + let e = spec.events['KeeperRewardGuardsSet'].decode(log) + ctx.store.PerpsMarketProxyEventKeeperRewardGuardsSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'KeeperRewardGuardsSet', + minKeeperRewardUsd: e[0].toString(), + minKeeperProfitRatioD18: e[1].toString(), + maxKeeperRewardUsd: e[2].toString(), + maxKeeperScalingRatioD18: e[3].toString(), + }) + break + } + case spec.events['PerAccountCapsSet'].topic: { + let e = spec.events['PerAccountCapsSet'].decode(log) + ctx.store.PerpsMarketProxyEventPerAccountCapsSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'PerAccountCapsSet', + maxPositionsPerAccount: e[0].toString(), + maxCollateralsPerAccount: e[1].toString(), + }) + break + } + case spec.events['ReferrerShareUpdated'].topic: { + let e = spec.events['ReferrerShareUpdated'].decode(log) + ctx.store.PerpsMarketProxyEventReferrerShareUpdated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'ReferrerShareUpdated', + referrer: e[0], + shareRatioD18: e[1].toString(), + }) + break + } + } + } + catch (error) { + ctx.log.error({error, blockNumber: log.block.height, blockHash: log.block.hash, address}, `Unable to decode event "${log.topics[0]}"`) + } +} + +export function parseFunction(ctx: DataHandlerContext, transaction: Transaction) { + try { + switch (transaction.input.slice(0, 10)) { + } + } + catch (error) { + ctx.log.error({error, blockNumber: transaction.block.height, blockHash: transaction.block.hash, address}, `Unable to decode function "${transaction.input.slice(0, 10)}"`) + } +} diff --git a/indexers/arbitrum-sepolia/src/mapping/spotMarketProxy.ts b/indexers/arbitrum-sepolia/src/mapping/spotMarketProxy.ts new file mode 100644 index 00000000..65056262 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/mapping/spotMarketProxy.ts @@ -0,0 +1,580 @@ +import {DataHandlerContext} from '@subsquid/evm-processor' +import {toJSON} from '@subsquid/util-internal-json' +import {Store} from '../db' +import * as spec from '../abi/SpotMarketProxy' +import {Log, Transaction} from '../processor' + +const address = '0x93d645c42a0ca3e08e9552367b8c454765fff041' + + +export function parseEvent(ctx: DataHandlerContext, log: Log) { + try { + switch (log.topics[0]) { + case spec.events['OwnerChanged'].topic: { + let e = spec.events['OwnerChanged'].decode(log) + ctx.store.SpotMarketProxyEventOwnerChanged.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OwnerChanged', + oldOwner: e[0], + newOwner: e[1], + }) + break + } + case spec.events['OwnerNominated'].topic: { + let e = spec.events['OwnerNominated'].decode(log) + ctx.store.SpotMarketProxyEventOwnerNominated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OwnerNominated', + newOwner: e[0], + }) + break + } + case spec.events['Upgraded'].topic: { + let e = spec.events['Upgraded'].decode(log) + ctx.store.SpotMarketProxyEventUpgraded.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'Upgraded', + self: e[0], + implementation: e[1], + }) + break + } + case spec.events['AssociatedSystemSet'].topic: { + let e = spec.events['AssociatedSystemSet'].decode(log) + ctx.store.SpotMarketProxyEventAssociatedSystemSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'AssociatedSystemSet', + kind: e[0], + id0: e[1], + proxy: e[2], + impl: e[3], + }) + break + } + case spec.events['DecayRateUpdated'].topic: { + let e = spec.events['DecayRateUpdated'].decode(log) + ctx.store.SpotMarketProxyEventDecayRateUpdated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'DecayRateUpdated', + marketId: e[0].toString(), + rate: e[1].toString(), + }) + break + } + case spec.events['MarketNominationRenounced'].topic: { + let e = spec.events['MarketNominationRenounced'].decode(log) + ctx.store.SpotMarketProxyEventMarketNominationRenounced.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketNominationRenounced', + marketId: e[0].toString(), + nominee: e[1], + }) + break + } + case spec.events['MarketOwnerChanged'].topic: { + let e = spec.events['MarketOwnerChanged'].decode(log) + ctx.store.SpotMarketProxyEventMarketOwnerChanged.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketOwnerChanged', + marketId: e[0].toString(), + oldOwner: e[1], + newOwner: e[2], + }) + break + } + case spec.events['MarketOwnerNominated'].topic: { + let e = spec.events['MarketOwnerNominated'].decode(log) + ctx.store.SpotMarketProxyEventMarketOwnerNominated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketOwnerNominated', + marketId: e[0].toString(), + newOwner: e[1], + }) + break + } + case spec.events['SynthImplementationSet'].topic: { + let e = spec.events['SynthImplementationSet'].decode(log) + ctx.store.SpotMarketProxyEventSynthImplementationSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SynthImplementationSet', + synthImplementation: e[0], + }) + break + } + case spec.events['SynthImplementationUpgraded'].topic: { + let e = spec.events['SynthImplementationUpgraded'].decode(log) + ctx.store.SpotMarketProxyEventSynthImplementationUpgraded.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SynthImplementationUpgraded', + synthMarketId: e[0].toString(), + proxy: e[1], + implementation: e[2], + }) + break + } + case spec.events['SynthPriceDataUpdated'].topic: { + let e = spec.events['SynthPriceDataUpdated'].decode(log) + ctx.store.SpotMarketProxyEventSynthPriceDataUpdated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SynthPriceDataUpdated', + synthMarketId: e[0].toString(), + buyFeedId: e[1], + sellFeedId: e[2], + strictStalenessTolerance: e[3].toString(), + }) + break + } + case spec.events['SynthRegistered'].topic: { + let e = spec.events['SynthRegistered'].decode(log) + ctx.store.SpotMarketProxyEventSynthRegistered.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SynthRegistered', + synthMarketId: e[0].toString(), + synthTokenAddress: e[1], + }) + break + } + case spec.events['SynthetixSystemSet'].topic: { + let e = spec.events['SynthetixSystemSet'].decode(log) + ctx.store.SpotMarketProxyEventSynthetixSystemSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SynthetixSystemSet', + synthetix: e[0], + usdTokenAddress: e[1], + oracleManager: e[2], + }) + break + } + case spec.events['SynthBought'].topic: { + let e = spec.events['SynthBought'].decode(log) + ctx.store.SpotMarketProxyEventSynthBought.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SynthBought', + synthMarketId: e[0].toString(), + synthReturned: e[1].toString(), + fees: toJSON(e[2]), + collectedFees: e[3].toString(), + referrer: e[4], + price: e[5].toString(), + }) + break + } + case spec.events['SynthSold'].topic: { + let e = spec.events['SynthSold'].decode(log) + ctx.store.SpotMarketProxyEventSynthSold.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SynthSold', + synthMarketId: e[0].toString(), + amountReturned: e[1].toString(), + fees: toJSON(e[2]), + collectedFees: e[3].toString(), + referrer: e[4], + price: e[5].toString(), + }) + break + } + case spec.events['OrderCancelled'].topic: { + let e = spec.events['OrderCancelled'].decode(log) + ctx.store.SpotMarketProxyEventOrderCancelled.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OrderCancelled', + marketId: e[0].toString(), + asyncOrderId: e[1].toString(), + asyncOrderClaim: toJSON(e[2]), + sender: e[3], + }) + break + } + case spec.events['OrderCommitted'].topic: { + let e = spec.events['OrderCommitted'].decode(log) + ctx.store.SpotMarketProxyEventOrderCommitted.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OrderCommitted', + marketId: e[0].toString(), + orderType: e[1], + amountProvided: e[2].toString(), + asyncOrderId: e[3].toString(), + sender: e[4], + referrer: e[5], + }) + break + } + case spec.events['OrderSettled'].topic: { + let e = spec.events['OrderSettled'].decode(log) + ctx.store.SpotMarketProxyEventOrderSettled.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'OrderSettled', + marketId: e[0].toString(), + asyncOrderId: e[1].toString(), + finalOrderAmount: e[2].toString(), + fees: toJSON(e[3]), + collectedFees: e[4].toString(), + settler: e[5], + price: e[6].toString(), + orderType: e[7], + }) + break + } + case spec.events['SettlementStrategyAdded'].topic: { + let e = spec.events['SettlementStrategyAdded'].decode(log) + ctx.store.SpotMarketProxyEventSettlementStrategyAdded.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SettlementStrategyAdded', + synthMarketId: e[0].toString(), + strategyId: e[1].toString(), + }) + break + } + case spec.events['SettlementStrategySet'].topic: { + let e = spec.events['SettlementStrategySet'].decode(log) + ctx.store.SpotMarketProxyEventSettlementStrategySet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SettlementStrategySet', + synthMarketId: e[0].toString(), + strategyId: e[1].toString(), + strategy: toJSON(e[2]), + }) + break + } + case spec.events['SynthUnwrapped'].topic: { + let e = spec.events['SynthUnwrapped'].decode(log) + ctx.store.SpotMarketProxyEventSynthUnwrapped.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SynthUnwrapped', + synthMarketId: e[0].toString(), + amountUnwrapped: e[1].toString(), + fees: toJSON(e[2]), + feesCollected: e[3].toString(), + }) + break + } + case spec.events['SynthWrapped'].topic: { + let e = spec.events['SynthWrapped'].decode(log) + ctx.store.SpotMarketProxyEventSynthWrapped.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'SynthWrapped', + synthMarketId: e[0].toString(), + amountWrapped: e[1].toString(), + fees: toJSON(e[2]), + feesCollected: e[3].toString(), + }) + break + } + case spec.events['WrapperSet'].topic: { + let e = spec.events['WrapperSet'].decode(log) + ctx.store.SpotMarketProxyEventWrapperSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'WrapperSet', + synthMarketId: e[0].toString(), + wrapCollateralType: e[1], + maxWrappableAmount: e[2].toString(), + }) + break + } + case spec.events['AsyncFixedFeeSet'].topic: { + let e = spec.events['AsyncFixedFeeSet'].decode(log) + ctx.store.SpotMarketProxyEventAsyncFixedFeeSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'AsyncFixedFeeSet', + synthMarketId: e[0].toString(), + asyncFixedFee: e[1].toString(), + }) + break + } + case spec.events['AtomicFixedFeeSet'].topic: { + let e = spec.events['AtomicFixedFeeSet'].decode(log) + ctx.store.SpotMarketProxyEventAtomicFixedFeeSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'AtomicFixedFeeSet', + synthMarketId: e[0].toString(), + atomicFixedFee: e[1].toString(), + }) + break + } + case spec.events['CollateralLeverageSet'].topic: { + let e = spec.events['CollateralLeverageSet'].decode(log) + ctx.store.SpotMarketProxyEventCollateralLeverageSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'CollateralLeverageSet', + synthMarketId: e[0].toString(), + collateralLeverage: e[1].toString(), + }) + break + } + case spec.events['FeeCollectorSet'].topic: { + let e = spec.events['FeeCollectorSet'].decode(log) + ctx.store.SpotMarketProxyEventFeeCollectorSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeeCollectorSet', + synthMarketId: e[0].toString(), + feeCollector: e[1], + }) + break + } + case spec.events['MarketSkewScaleSet'].topic: { + let e = spec.events['MarketSkewScaleSet'].decode(log) + ctx.store.SpotMarketProxyEventMarketSkewScaleSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketSkewScaleSet', + synthMarketId: e[0].toString(), + skewScale: e[1].toString(), + }) + break + } + case spec.events['MarketUtilizationFeesSet'].topic: { + let e = spec.events['MarketUtilizationFeesSet'].decode(log) + ctx.store.SpotMarketProxyEventMarketUtilizationFeesSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'MarketUtilizationFeesSet', + synthMarketId: e[0].toString(), + utilizationFeeRate: e[1].toString(), + }) + break + } + case spec.events['ReferrerShareUpdated'].topic: { + let e = spec.events['ReferrerShareUpdated'].decode(log) + ctx.store.SpotMarketProxyEventReferrerShareUpdated.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'ReferrerShareUpdated', + marketId: e[0].toString(), + referrer: e[1], + sharePercentage: e[2].toString(), + }) + break + } + case spec.events['TransactorFixedFeeSet'].topic: { + let e = spec.events['TransactorFixedFeeSet'].decode(log) + ctx.store.SpotMarketProxyEventTransactorFixedFeeSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'TransactorFixedFeeSet', + synthMarketId: e[0].toString(), + transactor: e[1], + fixedFeeAmount: e[2].toString(), + }) + break + } + case spec.events['WrapperFeesSet'].topic: { + let e = spec.events['WrapperFeesSet'].decode(log) + ctx.store.SpotMarketProxyEventWrapperFeesSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'WrapperFeesSet', + synthMarketId: e[0].toString(), + wrapFee: e[1].toString(), + unwrapFee: e[2].toString(), + }) + break + } + case spec.events['FeatureFlagAllowAllSet'].topic: { + let e = spec.events['FeatureFlagAllowAllSet'].decode(log) + ctx.store.SpotMarketProxyEventFeatureFlagAllowAllSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagAllowAllSet', + feature: e[0], + allowAll: e[1], + }) + break + } + case spec.events['FeatureFlagAllowlistAdded'].topic: { + let e = spec.events['FeatureFlagAllowlistAdded'].decode(log) + ctx.store.SpotMarketProxyEventFeatureFlagAllowlistAdded.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagAllowlistAdded', + feature: e[0], + account: e[1], + }) + break + } + case spec.events['FeatureFlagAllowlistRemoved'].topic: { + let e = spec.events['FeatureFlagAllowlistRemoved'].decode(log) + ctx.store.SpotMarketProxyEventFeatureFlagAllowlistRemoved.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagAllowlistRemoved', + feature: e[0], + account: e[1], + }) + break + } + case spec.events['FeatureFlagDeniersReset'].topic: { + let e = spec.events['FeatureFlagDeniersReset'].decode(log) + ctx.store.SpotMarketProxyEventFeatureFlagDeniersReset.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagDeniersReset', + feature: e[0], + deniers: toJSON(e[1]), + }) + break + } + case spec.events['FeatureFlagDenyAllSet'].topic: { + let e = spec.events['FeatureFlagDenyAllSet'].decode(log) + ctx.store.SpotMarketProxyEventFeatureFlagDenyAllSet.write({ + id: log.id, + blockNumber: log.block.height, + blockTimestamp: new Date(log.block.timestamp), + transactionHash: log.transactionHash, + contract: log.address, + eventName: 'FeatureFlagDenyAllSet', + feature: e[0], + denyAll: e[1], + }) + break + } + } + } + catch (error) { + ctx.log.error({error, blockNumber: log.block.height, blockHash: log.block.hash, address}, `Unable to decode event "${log.topics[0]}"`) + } +} + +export function parseFunction(ctx: DataHandlerContext, transaction: Transaction) { + try { + switch (transaction.input.slice(0, 10)) { + } + } + catch (error) { + ctx.log.error({error, blockNumber: transaction.block.height, blockHash: transaction.block.hash, address}, `Unable to decode function "${transaction.input.slice(0, 10)}"`) + } +} diff --git a/indexers/arbitrum-sepolia/src/processor.ts b/indexers/arbitrum-sepolia/src/processor.ts new file mode 100644 index 00000000..692ec0c0 --- /dev/null +++ b/indexers/arbitrum-sepolia/src/processor.ts @@ -0,0 +1,210 @@ +import {EvmBatchProcessor, EvmBatchProcessorFields, BlockHeader, Log as _Log, Transaction as _Transaction} from '@subsquid/evm-processor' +import * as coreProxyAbi from './abi/CoreProxy' +import * as accountProxyAbi from './abi/AccountProxy' +import * as spotMarketProxyAbi from './abi/SpotMarketProxy' +import * as perpsMarketProxyAbi from './abi/PerpsMarketProxy' +import * as perpsAccountProxyAbi from './abi/PerpsAccountProxy' + +export const processor = new EvmBatchProcessor() + .setDataSource({ + archive: 'https://v2.archive.subsquid.io/network/arbitrum-sepolia', + chain: { + url: 'https://sepolia-rollup.arbitrum.io/rpc', + rateLimit: 15, + }, + }) + .setFinalityConfirmation(1) + .setBlockRange({from: 40_000_000}) + .setFields({ + log: { + topics: true, + data: true, + transactionHash: true, + }, + transaction: { + hash: true, + input: true, + from: true, + value: true, + status: true, + } + }) + .addLog({ + address: ['0x76490713314fcec173f44e99346f54c6e92a8e42'], + topic0: [ + coreProxyAbi.events['OwnerChanged'].topic, + coreProxyAbi.events['OwnerNominated'].topic, + coreProxyAbi.events['Upgraded'].topic, + coreProxyAbi.events['FeatureFlagAllowAllSet'].topic, + coreProxyAbi.events['FeatureFlagAllowlistAdded'].topic, + coreProxyAbi.events['FeatureFlagAllowlistRemoved'].topic, + coreProxyAbi.events['FeatureFlagDeniersReset'].topic, + coreProxyAbi.events['FeatureFlagDenyAllSet'].topic, + coreProxyAbi.events['AccountCreated'].topic, + coreProxyAbi.events['PermissionGranted'].topic, + coreProxyAbi.events['PermissionRevoked'].topic, + coreProxyAbi.events['DebtAssociated'].topic, + coreProxyAbi.events['AssociatedSystemSet'].topic, + coreProxyAbi.events['CollateralLockCreated'].topic, + coreProxyAbi.events['CollateralLockExpired'].topic, + coreProxyAbi.events['Deposited'].topic, + coreProxyAbi.events['Withdrawn'].topic, + coreProxyAbi.events['CollateralConfigured'].topic, + coreProxyAbi.events['TransferCrossChainInitiated'].topic, + coreProxyAbi.events['IssuanceFeePaid'].topic, + coreProxyAbi.events['UsdBurned'].topic, + coreProxyAbi.events['UsdMinted'].topic, + coreProxyAbi.events['Liquidation'].topic, + coreProxyAbi.events['VaultLiquidation'].topic, + coreProxyAbi.events['MarketCollateralDeposited'].topic, + coreProxyAbi.events['MarketCollateralWithdrawn'].topic, + coreProxyAbi.events['MaximumMarketCollateralConfigured'].topic, + coreProxyAbi.events['MarketRegistered'].topic, + coreProxyAbi.events['MarketSystemFeePaid'].topic, + coreProxyAbi.events['MarketUsdDeposited'].topic, + coreProxyAbi.events['MarketUsdWithdrawn'].topic, + coreProxyAbi.events['SetMarketMinLiquidityRatio'].topic, + coreProxyAbi.events['SetMinDelegateTime'].topic, + coreProxyAbi.events['PoolApprovedAdded'].topic, + coreProxyAbi.events['PoolApprovedRemoved'].topic, + coreProxyAbi.events['PreferredPoolSet'].topic, + coreProxyAbi.events['PoolCollateralConfigurationUpdated'].topic, + coreProxyAbi.events['PoolCollateralDisabledByDefaultSet'].topic, + coreProxyAbi.events['PoolConfigurationSet'].topic, + coreProxyAbi.events['PoolCreated'].topic, + coreProxyAbi.events['PoolNameUpdated'].topic, + coreProxyAbi.events['PoolNominationRenounced'].topic, + coreProxyAbi.events['PoolNominationRevoked'].topic, + coreProxyAbi.events['PoolOwnerNominated'].topic, + coreProxyAbi.events['PoolOwnershipAccepted'].topic, + coreProxyAbi.events['PoolOwnershipRenounced'].topic, + coreProxyAbi.events['SetMinLiquidityRatio'].topic, + coreProxyAbi.events['RewardsClaimed'].topic, + coreProxyAbi.events['RewardsDistributed'].topic, + coreProxyAbi.events['RewardsDistributorRegistered'].topic, + coreProxyAbi.events['RewardsDistributorRemoved'].topic, + coreProxyAbi.events['NewSupportedCrossChainNetwork'].topic, + coreProxyAbi.events['DelegationUpdated'].topic, + ], + }) + .addLog({ + address: ['0x1b791d05e437c78039424749243f5a79e747525e'], + topic0: [ + accountProxyAbi.events['OwnerChanged'].topic, + accountProxyAbi.events['OwnerNominated'].topic, + accountProxyAbi.events['Upgraded'].topic, + accountProxyAbi.events['Approval'].topic, + accountProxyAbi.events['ApprovalForAll'].topic, + accountProxyAbi.events['Transfer'].topic, + ], + }) + .addLog({ + address: ['0x93d645c42a0ca3e08e9552367b8c454765fff041'], + topic0: [ + spotMarketProxyAbi.events['OwnerChanged'].topic, + spotMarketProxyAbi.events['OwnerNominated'].topic, + spotMarketProxyAbi.events['Upgraded'].topic, + spotMarketProxyAbi.events['AssociatedSystemSet'].topic, + spotMarketProxyAbi.events['DecayRateUpdated'].topic, + spotMarketProxyAbi.events['MarketNominationRenounced'].topic, + spotMarketProxyAbi.events['MarketOwnerChanged'].topic, + spotMarketProxyAbi.events['MarketOwnerNominated'].topic, + spotMarketProxyAbi.events['SynthImplementationSet'].topic, + spotMarketProxyAbi.events['SynthImplementationUpgraded'].topic, + spotMarketProxyAbi.events['SynthPriceDataUpdated'].topic, + spotMarketProxyAbi.events['SynthRegistered'].topic, + spotMarketProxyAbi.events['SynthetixSystemSet'].topic, + spotMarketProxyAbi.events['SynthBought'].topic, + spotMarketProxyAbi.events['SynthSold'].topic, + spotMarketProxyAbi.events['OrderCancelled'].topic, + spotMarketProxyAbi.events['OrderCommitted'].topic, + spotMarketProxyAbi.events['OrderSettled'].topic, + spotMarketProxyAbi.events['SettlementStrategyAdded'].topic, + spotMarketProxyAbi.events['SettlementStrategySet'].topic, + spotMarketProxyAbi.events['SynthUnwrapped'].topic, + spotMarketProxyAbi.events['SynthWrapped'].topic, + spotMarketProxyAbi.events['WrapperSet'].topic, + spotMarketProxyAbi.events['AsyncFixedFeeSet'].topic, + spotMarketProxyAbi.events['AtomicFixedFeeSet'].topic, + spotMarketProxyAbi.events['CollateralLeverageSet'].topic, + spotMarketProxyAbi.events['FeeCollectorSet'].topic, + spotMarketProxyAbi.events['MarketSkewScaleSet'].topic, + spotMarketProxyAbi.events['MarketUtilizationFeesSet'].topic, + spotMarketProxyAbi.events['ReferrerShareUpdated'].topic, + spotMarketProxyAbi.events['TransactorFixedFeeSet'].topic, + spotMarketProxyAbi.events['WrapperFeesSet'].topic, + spotMarketProxyAbi.events['FeatureFlagAllowAllSet'].topic, + spotMarketProxyAbi.events['FeatureFlagAllowlistAdded'].topic, + spotMarketProxyAbi.events['FeatureFlagAllowlistRemoved'].topic, + spotMarketProxyAbi.events['FeatureFlagDeniersReset'].topic, + spotMarketProxyAbi.events['FeatureFlagDenyAllSet'].topic, + ], + }) + .addLog({ + address: ['0xa73a7b754ec870b3738d0654ca75b7d0eebdb460'], + topic0: [ + perpsMarketProxyAbi.events['AccountCreated'].topic, + perpsMarketProxyAbi.events['PermissionGranted'].topic, + perpsMarketProxyAbi.events['PermissionRevoked'].topic, + perpsMarketProxyAbi.events['AssociatedSystemSet'].topic, + perpsMarketProxyAbi.events['OwnerChanged'].topic, + perpsMarketProxyAbi.events['OwnerNominated'].topic, + perpsMarketProxyAbi.events['Upgraded'].topic, + perpsMarketProxyAbi.events['FactoryInitialized'].topic, + perpsMarketProxyAbi.events['MarketCreated'].topic, + perpsMarketProxyAbi.events['CollateralModified'].topic, + perpsMarketProxyAbi.events['DebtPaid'].topic, + perpsMarketProxyAbi.events['InterestRateUpdated'].topic, + perpsMarketProxyAbi.events['OrderCommitted'].topic, + perpsMarketProxyAbi.events['PreviousOrderExpired'].topic, + perpsMarketProxyAbi.events['AccountCharged'].topic, + perpsMarketProxyAbi.events['InterestCharged'].topic, + perpsMarketProxyAbi.events['MarketUpdated'].topic, + perpsMarketProxyAbi.events['OrderSettled'].topic, + perpsMarketProxyAbi.events['OrderCancelled'].topic, + perpsMarketProxyAbi.events['FeatureFlagAllowAllSet'].topic, + perpsMarketProxyAbi.events['FeatureFlagAllowlistAdded'].topic, + perpsMarketProxyAbi.events['FeatureFlagAllowlistRemoved'].topic, + perpsMarketProxyAbi.events['FeatureFlagDeniersReset'].topic, + perpsMarketProxyAbi.events['FeatureFlagDenyAllSet'].topic, + perpsMarketProxyAbi.events['AccountFlaggedForLiquidation'].topic, + perpsMarketProxyAbi.events['AccountLiquidationAttempt'].topic, + perpsMarketProxyAbi.events['AccountMarginLiquidation'].topic, + perpsMarketProxyAbi.events['PositionLiquidated'].topic, + perpsMarketProxyAbi.events['FundingParametersSet'].topic, + perpsMarketProxyAbi.events['LiquidationParametersSet'].topic, + perpsMarketProxyAbi.events['LockedOiRatioSet'].topic, + perpsMarketProxyAbi.events['MarketPriceDataUpdated'].topic, + perpsMarketProxyAbi.events['MaxLiquidationParametersSet'].topic, + perpsMarketProxyAbi.events['MaxMarketSizeSet'].topic, + perpsMarketProxyAbi.events['MaxMarketValueSet'].topic, + perpsMarketProxyAbi.events['OrderFeesSet'].topic, + perpsMarketProxyAbi.events['SettlementStrategyAdded'].topic, + perpsMarketProxyAbi.events['SettlementStrategySet'].topic, + perpsMarketProxyAbi.events['CollateralConfigurationSet'].topic, + perpsMarketProxyAbi.events['CollateralLiquidateRewardRatioSet'].topic, + perpsMarketProxyAbi.events['RewardDistributorRegistered'].topic, + perpsMarketProxyAbi.events['FeeCollectorSet'].topic, + perpsMarketProxyAbi.events['InterestRateParametersSet'].topic, + perpsMarketProxyAbi.events['KeeperCostNodeIdUpdated'].topic, + perpsMarketProxyAbi.events['KeeperRewardGuardsSet'].topic, + perpsMarketProxyAbi.events['PerAccountCapsSet'].topic, + perpsMarketProxyAbi.events['ReferrerShareUpdated'].topic, + ], + }) + .addLog({ + address: ['0xf3d4109eb4e7ec31f8eee5d9addad5f3c53a6c87'], + topic0: [ + perpsAccountProxyAbi.events['OwnerChanged'].topic, + perpsAccountProxyAbi.events['OwnerNominated'].topic, + perpsAccountProxyAbi.events['Upgraded'].topic, + perpsAccountProxyAbi.events['Approval'].topic, + perpsAccountProxyAbi.events['ApprovalForAll'].topic, + perpsAccountProxyAbi.events['Transfer'].topic, + ], + }) + +export type Fields = EvmBatchProcessorFields +export type Block = BlockHeader +export type Log = _Log +export type Transaction = _Transaction diff --git a/indexers/arbitrum-sepolia/src/table.ts b/indexers/arbitrum-sepolia/src/table.ts new file mode 100644 index 00000000..70942a2d --- /dev/null +++ b/indexers/arbitrum-sepolia/src/table.ts @@ -0,0 +1,2284 @@ +import {Table, Types, Column} from '@subsquid/file-store-parquet' + +export let Block = new Table( + 'block.parquet', + { + id: Column(Types.String(), {nullable: false}), + number: Column(Types.Int64(), {nullable: false}), + timestamp: Column(Types.Timestamp(), {nullable: false}), + } +) + +export let Transaction = new Table( + 'transaction.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: true}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + hash: Column(Types.String(), {nullable: false}), + to: Column(Types.String(), {nullable: true}), + from: Column(Types.String(), {nullable: true}), + status: Column(Types.Int64(), {nullable: true}), + } +) + +export let CoreProxyEventOwnerChanged = new Table( + 'core_proxy_event_owner_changed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + oldOwner: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventOwnerNominated = new Table( + 'core_proxy_event_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventUpgraded = new Table( + 'core_proxy_event_upgraded.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + self: Column(Types.String(), {nullable: false}), + implementation: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventFeatureFlagAllowAllSet = new Table( + 'core_proxy_event_feature_flag_allow_all_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + allowAll: Column(Types.Boolean(), {nullable: false}), + } +) + +export let CoreProxyEventFeatureFlagAllowlistAdded = new Table( + 'core_proxy_event_feature_flag_allowlist_added.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + account: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventFeatureFlagAllowlistRemoved = new Table( + 'core_proxy_event_feature_flag_allowlist_removed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + account: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventFeatureFlagDeniersReset = new Table( + 'core_proxy_event_feature_flag_deniers_reset.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + deniers: Column(Types.JSON(), {nullable: false}), + } +) + +export let CoreProxyEventFeatureFlagDenyAllSet = new Table( + 'core_proxy_event_feature_flag_deny_all_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + denyAll: Column(Types.Boolean(), {nullable: false}), + } +) + +export let CoreProxyEventAccountCreated = new Table( + 'core_proxy_event_account_created.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPermissionGranted = new Table( + 'core_proxy_event_permission_granted.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + permission: Column(Types.String(), {nullable: false}), + user: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPermissionRevoked = new Table( + 'core_proxy_event_permission_revoked.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + permission: Column(Types.String(), {nullable: false}), + user: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventDebtAssociated = new Table( + 'core_proxy_event_debt_associated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + amount: Column(Types.String(), {nullable: false}), + updatedDebt: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventAssociatedSystemSet = new Table( + 'core_proxy_event_associated_system_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + kind: Column(Types.String(), {nullable: false}), + id0: Column(Types.String(), {nullable: false}), + proxy: Column(Types.String(), {nullable: false}), + impl: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventCollateralLockCreated = new Table( + 'core_proxy_event_collateral_lock_created.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + tokenAmount: Column(Types.String(), {nullable: false}), + expireTimestamp: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventCollateralLockExpired = new Table( + 'core_proxy_event_collateral_lock_expired.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + tokenAmount: Column(Types.String(), {nullable: false}), + expireTimestamp: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventDeposited = new Table( + 'core_proxy_event_deposited.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + tokenAmount: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventWithdrawn = new Table( + 'core_proxy_event_withdrawn.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + tokenAmount: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventCollateralConfigured = new Table( + 'core_proxy_event_collateral_configured.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + config: Column(Types.JSON(), {nullable: false}), + } +) + +export let CoreProxyEventTransferCrossChainInitiated = new Table( + 'core_proxy_event_transfer_cross_chain_initiated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + destChainId: Column(Types.String(), {nullable: false}), + amount: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventIssuanceFeePaid = new Table( + 'core_proxy_event_issuance_fee_paid.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + feeAmount: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventUsdBurned = new Table( + 'core_proxy_event_usd_burned.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + amount: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventUsdMinted = new Table( + 'core_proxy_event_usd_minted.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + amount: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventLiquidation = new Table( + 'core_proxy_event_liquidation.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + liquidationData: Column(Types.JSON(), {nullable: false}), + liquidateAsAccountId: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventVaultLiquidation = new Table( + 'core_proxy_event_vault_liquidation.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + liquidationData: Column(Types.JSON(), {nullable: false}), + liquidateAsAccountId: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventMarketCollateralDeposited = new Table( + 'core_proxy_event_market_collateral_deposited.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + tokenAmount: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + creditCapacity: Column(Types.String(), {nullable: false}), + netIssuance: Column(Types.String(), {nullable: false}), + depositedCollateralValue: Column(Types.String(), {nullable: false}), + reportedDebt: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventMarketCollateralWithdrawn = new Table( + 'core_proxy_event_market_collateral_withdrawn.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + tokenAmount: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + creditCapacity: Column(Types.String(), {nullable: false}), + netIssuance: Column(Types.String(), {nullable: false}), + depositedCollateralValue: Column(Types.String(), {nullable: false}), + reportedDebt: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventMaximumMarketCollateralConfigured = new Table( + 'core_proxy_event_maximum_market_collateral_configured.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + systemAmount: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventMarketRegistered = new Table( + 'core_proxy_event_market_registered.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + market: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventMarketSystemFeePaid = new Table( + 'core_proxy_event_market_system_fee_paid.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + feeAmount: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventMarketUsdDeposited = new Table( + 'core_proxy_event_market_usd_deposited.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + target: Column(Types.String(), {nullable: false}), + amount: Column(Types.String(), {nullable: false}), + market: Column(Types.String(), {nullable: false}), + creditCapacity: Column(Types.String(), {nullable: false}), + netIssuance: Column(Types.String(), {nullable: false}), + depositedCollateralValue: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventMarketUsdWithdrawn = new Table( + 'core_proxy_event_market_usd_withdrawn.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + target: Column(Types.String(), {nullable: false}), + amount: Column(Types.String(), {nullable: false}), + market: Column(Types.String(), {nullable: false}), + creditCapacity: Column(Types.String(), {nullable: false}), + netIssuance: Column(Types.String(), {nullable: false}), + depositedCollateralValue: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventSetMarketMinLiquidityRatio = new Table( + 'core_proxy_event_set_market_min_liquidity_ratio.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + minLiquidityRatio: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventSetMinDelegateTime = new Table( + 'core_proxy_event_set_min_delegate_time.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + minDelegateTime: Column(Types.Int64(), {nullable: false}), + } +) + +export let CoreProxyEventPoolApprovedAdded = new Table( + 'core_proxy_event_pool_approved_added.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolApprovedRemoved = new Table( + 'core_proxy_event_pool_approved_removed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPreferredPoolSet = new Table( + 'core_proxy_event_preferred_pool_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolCollateralConfigurationUpdated = new Table( + 'core_proxy_event_pool_collateral_configuration_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + config: Column(Types.JSON(), {nullable: false}), + } +) + +export let CoreProxyEventPoolCollateralDisabledByDefaultSet = new Table( + 'core_proxy_event_pool_collateral_disabled_by_default_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + disabled: Column(Types.Boolean(), {nullable: false}), + } +) + +export let CoreProxyEventPoolConfigurationSet = new Table( + 'core_proxy_event_pool_configuration_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + markets: Column(Types.JSON(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolCreated = new Table( + 'core_proxy_event_pool_created.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolNameUpdated = new Table( + 'core_proxy_event_pool_name_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + name: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolNominationRenounced = new Table( + 'core_proxy_event_pool_nomination_renounced.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolNominationRevoked = new Table( + 'core_proxy_event_pool_nomination_revoked.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolOwnerNominated = new Table( + 'core_proxy_event_pool_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + nominatedOwner: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolOwnershipAccepted = new Table( + 'core_proxy_event_pool_ownership_accepted.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolOwnershipRenounced = new Table( + 'core_proxy_event_pool_ownership_renounced.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventSetMinLiquidityRatio = new Table( + 'core_proxy_event_set_min_liquidity_ratio.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + minLiquidityRatio: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventRewardsClaimed = new Table( + 'core_proxy_event_rewards_claimed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + distributor: Column(Types.String(), {nullable: false}), + amount: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventRewardsDistributed = new Table( + 'core_proxy_event_rewards_distributed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + distributor: Column(Types.String(), {nullable: false}), + amount: Column(Types.String(), {nullable: false}), + start: Column(Types.String(), {nullable: false}), + duration: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventRewardsDistributorRegistered = new Table( + 'core_proxy_event_rewards_distributor_registered.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + distributor: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventRewardsDistributorRemoved = new Table( + 'core_proxy_event_rewards_distributor_removed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + distributor: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventNewSupportedCrossChainNetwork = new Table( + 'core_proxy_event_new_supported_cross_chain_network.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + newChainId: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventDelegationUpdated = new Table( + 'core_proxy_event_delegation_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + poolId: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + amount: Column(Types.String(), {nullable: false}), + leverage: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let AccountProxyEventOwnerChanged = new Table( + 'account_proxy_event_owner_changed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + oldOwner: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let AccountProxyEventOwnerNominated = new Table( + 'account_proxy_event_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let AccountProxyEventUpgraded = new Table( + 'account_proxy_event_upgraded.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + self: Column(Types.String(), {nullable: false}), + implementation: Column(Types.String(), {nullable: false}), + } +) + +export let AccountProxyEventApproval = new Table( + 'account_proxy_event_approval.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + approved: Column(Types.String(), {nullable: false}), + tokenId: Column(Types.String(), {nullable: false}), + } +) + +export let AccountProxyEventApprovalForAll = new Table( + 'account_proxy_event_approval_for_all.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + operator: Column(Types.String(), {nullable: false}), + approved: Column(Types.Boolean(), {nullable: false}), + } +) + +export let AccountProxyEventTransfer = new Table( + 'account_proxy_event_transfer.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + from: Column(Types.String(), {nullable: false}), + to: Column(Types.String(), {nullable: false}), + tokenId: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventOwnerChanged = new Table( + 'spot_market_proxy_event_owner_changed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + oldOwner: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventOwnerNominated = new Table( + 'spot_market_proxy_event_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventUpgraded = new Table( + 'spot_market_proxy_event_upgraded.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + self: Column(Types.String(), {nullable: false}), + implementation: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventAssociatedSystemSet = new Table( + 'spot_market_proxy_event_associated_system_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + kind: Column(Types.String(), {nullable: false}), + id0: Column(Types.String(), {nullable: false}), + proxy: Column(Types.String(), {nullable: false}), + impl: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventDecayRateUpdated = new Table( + 'spot_market_proxy_event_decay_rate_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + rate: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventMarketNominationRenounced = new Table( + 'spot_market_proxy_event_market_nomination_renounced.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + nominee: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventMarketOwnerChanged = new Table( + 'spot_market_proxy_event_market_owner_changed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + oldOwner: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventMarketOwnerNominated = new Table( + 'spot_market_proxy_event_market_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthImplementationSet = new Table( + 'spot_market_proxy_event_synth_implementation_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthImplementation: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthImplementationUpgraded = new Table( + 'spot_market_proxy_event_synth_implementation_upgraded.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + proxy: Column(Types.String(), {nullable: false}), + implementation: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthPriceDataUpdated = new Table( + 'spot_market_proxy_event_synth_price_data_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + buyFeedId: Column(Types.String(), {nullable: false}), + sellFeedId: Column(Types.String(), {nullable: false}), + strictStalenessTolerance: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthRegistered = new Table( + 'spot_market_proxy_event_synth_registered.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + synthTokenAddress: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthetixSystemSet = new Table( + 'spot_market_proxy_event_synthetix_system_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthetix: Column(Types.String(), {nullable: false}), + usdTokenAddress: Column(Types.String(), {nullable: false}), + oracleManager: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthBought = new Table( + 'spot_market_proxy_event_synth_bought.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + synthReturned: Column(Types.String(), {nullable: false}), + fees: Column(Types.JSON(), {nullable: false}), + collectedFees: Column(Types.String(), {nullable: false}), + referrer: Column(Types.String(), {nullable: false}), + price: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthSold = new Table( + 'spot_market_proxy_event_synth_sold.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + amountReturned: Column(Types.String(), {nullable: false}), + fees: Column(Types.JSON(), {nullable: false}), + collectedFees: Column(Types.String(), {nullable: false}), + referrer: Column(Types.String(), {nullable: false}), + price: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventOrderCancelled = new Table( + 'spot_market_proxy_event_order_cancelled.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + asyncOrderId: Column(Types.String(), {nullable: false}), + asyncOrderClaim: Column(Types.JSON(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventOrderCommitted = new Table( + 'spot_market_proxy_event_order_committed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + orderType: Column(Types.Int64(), {nullable: false}), + amountProvided: Column(Types.String(), {nullable: false}), + asyncOrderId: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + referrer: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventOrderSettled = new Table( + 'spot_market_proxy_event_order_settled.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + asyncOrderId: Column(Types.String(), {nullable: false}), + finalOrderAmount: Column(Types.String(), {nullable: false}), + fees: Column(Types.JSON(), {nullable: false}), + collectedFees: Column(Types.String(), {nullable: false}), + settler: Column(Types.String(), {nullable: false}), + price: Column(Types.String(), {nullable: false}), + orderType: Column(Types.Int64(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSettlementStrategyAdded = new Table( + 'spot_market_proxy_event_settlement_strategy_added.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + strategyId: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSettlementStrategySet = new Table( + 'spot_market_proxy_event_settlement_strategy_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + strategyId: Column(Types.String(), {nullable: false}), + strategy: Column(Types.JSON(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthUnwrapped = new Table( + 'spot_market_proxy_event_synth_unwrapped.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + amountUnwrapped: Column(Types.String(), {nullable: false}), + fees: Column(Types.JSON(), {nullable: false}), + feesCollected: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthWrapped = new Table( + 'spot_market_proxy_event_synth_wrapped.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + amountWrapped: Column(Types.String(), {nullable: false}), + fees: Column(Types.JSON(), {nullable: false}), + feesCollected: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventWrapperSet = new Table( + 'spot_market_proxy_event_wrapper_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + wrapCollateralType: Column(Types.String(), {nullable: false}), + maxWrappableAmount: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventAsyncFixedFeeSet = new Table( + 'spot_market_proxy_event_async_fixed_fee_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + asyncFixedFee: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventAtomicFixedFeeSet = new Table( + 'spot_market_proxy_event_atomic_fixed_fee_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + atomicFixedFee: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventCollateralLeverageSet = new Table( + 'spot_market_proxy_event_collateral_leverage_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + collateralLeverage: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventFeeCollectorSet = new Table( + 'spot_market_proxy_event_fee_collector_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + feeCollector: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventMarketSkewScaleSet = new Table( + 'spot_market_proxy_event_market_skew_scale_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + skewScale: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventMarketUtilizationFeesSet = new Table( + 'spot_market_proxy_event_market_utilization_fees_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + utilizationFeeRate: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventReferrerShareUpdated = new Table( + 'spot_market_proxy_event_referrer_share_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + referrer: Column(Types.String(), {nullable: false}), + sharePercentage: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventTransactorFixedFeeSet = new Table( + 'spot_market_proxy_event_transactor_fixed_fee_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + transactor: Column(Types.String(), {nullable: false}), + fixedFeeAmount: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventWrapperFeesSet = new Table( + 'spot_market_proxy_event_wrapper_fees_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.String(), {nullable: false}), + wrapFee: Column(Types.String(), {nullable: false}), + unwrapFee: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventFeatureFlagAllowAllSet = new Table( + 'spot_market_proxy_event_feature_flag_allow_all_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + allowAll: Column(Types.Boolean(), {nullable: false}), + } +) + +export let SpotMarketProxyEventFeatureFlagAllowlistAdded = new Table( + 'spot_market_proxy_event_feature_flag_allowlist_added.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + account: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventFeatureFlagAllowlistRemoved = new Table( + 'spot_market_proxy_event_feature_flag_allowlist_removed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + account: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventFeatureFlagDeniersReset = new Table( + 'spot_market_proxy_event_feature_flag_deniers_reset.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + deniers: Column(Types.JSON(), {nullable: false}), + } +) + +export let SpotMarketProxyEventFeatureFlagDenyAllSet = new Table( + 'spot_market_proxy_event_feature_flag_deny_all_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + denyAll: Column(Types.Boolean(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventAccountCreated = new Table( + 'perps_market_proxy_event_account_created.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventPermissionGranted = new Table( + 'perps_market_proxy_event_permission_granted.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + permission: Column(Types.String(), {nullable: false}), + user: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventPermissionRevoked = new Table( + 'perps_market_proxy_event_permission_revoked.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + permission: Column(Types.String(), {nullable: false}), + user: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventAssociatedSystemSet = new Table( + 'perps_market_proxy_event_associated_system_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + kind: Column(Types.String(), {nullable: false}), + id0: Column(Types.String(), {nullable: false}), + proxy: Column(Types.String(), {nullable: false}), + impl: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventOwnerChanged = new Table( + 'perps_market_proxy_event_owner_changed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + oldOwner: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventOwnerNominated = new Table( + 'perps_market_proxy_event_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventUpgraded = new Table( + 'perps_market_proxy_event_upgraded.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + self: Column(Types.String(), {nullable: false}), + implementation: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFactoryInitialized = new Table( + 'perps_market_proxy_event_factory_initialized.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + globalPerpsMarketId: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventMarketCreated = new Table( + 'perps_market_proxy_event_market_created.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + perpsMarketId: Column(Types.String(), {nullable: false}), + marketName: Column(Types.String(), {nullable: false}), + marketSymbol: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventCollateralModified = new Table( + 'perps_market_proxy_event_collateral_modified.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + collateralId: Column(Types.String(), {nullable: false}), + amountDelta: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventDebtPaid = new Table( + 'perps_market_proxy_event_debt_paid.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + amount: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventInterestRateUpdated = new Table( + 'perps_market_proxy_event_interest_rate_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + superMarketId: Column(Types.String(), {nullable: false}), + interestRate: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventOrderCommitted = new Table( + 'perps_market_proxy_event_order_committed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + orderType: Column(Types.Int64(), {nullable: false}), + sizeDelta: Column(Types.String(), {nullable: false}), + acceptablePrice: Column(Types.String(), {nullable: false}), + commitmentTime: Column(Types.String(), {nullable: false}), + expectedPriceTime: Column(Types.String(), {nullable: false}), + settlementTime: Column(Types.String(), {nullable: false}), + expirationTime: Column(Types.String(), {nullable: false}), + trackingCode: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventPreviousOrderExpired = new Table( + 'perps_market_proxy_event_previous_order_expired.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + sizeDelta: Column(Types.String(), {nullable: false}), + acceptablePrice: Column(Types.String(), {nullable: false}), + commitmentTime: Column(Types.String(), {nullable: false}), + trackingCode: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventAccountCharged = new Table( + 'perps_market_proxy_event_account_charged.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + amount: Column(Types.String(), {nullable: false}), + accountDebt: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventInterestCharged = new Table( + 'perps_market_proxy_event_interest_charged.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + interest: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventMarketUpdated = new Table( + 'perps_market_proxy_event_market_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + price: Column(Types.String(), {nullable: false}), + skew: Column(Types.String(), {nullable: false}), + size: Column(Types.String(), {nullable: false}), + sizeDelta: Column(Types.String(), {nullable: false}), + currentFundingRate: Column(Types.String(), {nullable: false}), + currentFundingVelocity: Column(Types.String(), {nullable: false}), + interestRate: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventOrderSettled = new Table( + 'perps_market_proxy_event_order_settled.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + fillPrice: Column(Types.String(), {nullable: false}), + pnl: Column(Types.String(), {nullable: false}), + accruedFunding: Column(Types.String(), {nullable: false}), + sizeDelta: Column(Types.String(), {nullable: false}), + newSize: Column(Types.String(), {nullable: false}), + totalFees: Column(Types.String(), {nullable: false}), + referralFees: Column(Types.String(), {nullable: false}), + collectedFees: Column(Types.String(), {nullable: false}), + settlementReward: Column(Types.String(), {nullable: false}), + trackingCode: Column(Types.String(), {nullable: false}), + settler: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventOrderCancelled = new Table( + 'perps_market_proxy_event_order_cancelled.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + desiredPrice: Column(Types.String(), {nullable: false}), + fillPrice: Column(Types.String(), {nullable: false}), + sizeDelta: Column(Types.String(), {nullable: false}), + settlementReward: Column(Types.String(), {nullable: false}), + trackingCode: Column(Types.String(), {nullable: false}), + settler: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFeatureFlagAllowAllSet = new Table( + 'perps_market_proxy_event_feature_flag_allow_all_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + allowAll: Column(Types.Boolean(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFeatureFlagAllowlistAdded = new Table( + 'perps_market_proxy_event_feature_flag_allowlist_added.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + account: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFeatureFlagAllowlistRemoved = new Table( + 'perps_market_proxy_event_feature_flag_allowlist_removed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + account: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFeatureFlagDeniersReset = new Table( + 'perps_market_proxy_event_feature_flag_deniers_reset.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + deniers: Column(Types.JSON(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFeatureFlagDenyAllSet = new Table( + 'perps_market_proxy_event_feature_flag_deny_all_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + denyAll: Column(Types.Boolean(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventAccountFlaggedForLiquidation = new Table( + 'perps_market_proxy_event_account_flagged_for_liquidation.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + availableMargin: Column(Types.String(), {nullable: false}), + requiredMaintenanceMargin: Column(Types.String(), {nullable: false}), + liquidationReward: Column(Types.String(), {nullable: false}), + flagReward: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventAccountLiquidationAttempt = new Table( + 'perps_market_proxy_event_account_liquidation_attempt.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + reward: Column(Types.String(), {nullable: false}), + fullLiquidation: Column(Types.Boolean(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventAccountMarginLiquidation = new Table( + 'perps_market_proxy_event_account_margin_liquidation.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + seizedMarginValue: Column(Types.String(), {nullable: false}), + liquidationReward: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventPositionLiquidated = new Table( + 'perps_market_proxy_event_position_liquidated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + amountLiquidated: Column(Types.String(), {nullable: false}), + currentPositionSize: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFundingParametersSet = new Table( + 'perps_market_proxy_event_funding_parameters_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + skewScale: Column(Types.String(), {nullable: false}), + maxFundingVelocity: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventLiquidationParametersSet = new Table( + 'perps_market_proxy_event_liquidation_parameters_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + initialMarginRatioD18: Column(Types.String(), {nullable: false}), + maintenanceMarginRatioD18: Column(Types.String(), {nullable: false}), + minimumInitialMarginRatioD18: Column(Types.String(), {nullable: false}), + flagRewardRatioD18: Column(Types.String(), {nullable: false}), + minimumPositionMargin: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventLockedOiRatioSet = new Table( + 'perps_market_proxy_event_locked_oi_ratio_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + lockedOiRatioD18: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventMarketPriceDataUpdated = new Table( + 'perps_market_proxy_event_market_price_data_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + feedId: Column(Types.String(), {nullable: false}), + strictStalenessTolerance: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventMaxLiquidationParametersSet = new Table( + 'perps_market_proxy_event_max_liquidation_parameters_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + maxLiquidationLimitAccumulationMultiplier: Column(Types.String(), {nullable: false}), + maxSecondsInLiquidationWindow: Column(Types.String(), {nullable: false}), + maxLiquidationPd: Column(Types.String(), {nullable: false}), + endorsedLiquidator: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventMaxMarketSizeSet = new Table( + 'perps_market_proxy_event_max_market_size_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + maxMarketSize: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventMaxMarketValueSet = new Table( + 'perps_market_proxy_event_max_market_value_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + maxMarketValue: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventOrderFeesSet = new Table( + 'perps_market_proxy_event_order_fees_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + makerFeeRatio: Column(Types.String(), {nullable: false}), + takerFeeRatio: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventSettlementStrategyAdded = new Table( + 'perps_market_proxy_event_settlement_strategy_added.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + strategy: Column(Types.JSON(), {nullable: false}), + strategyId: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventSettlementStrategySet = new Table( + 'perps_market_proxy_event_settlement_strategy_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.String(), {nullable: false}), + strategyId: Column(Types.String(), {nullable: false}), + strategy: Column(Types.JSON(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventCollateralConfigurationSet = new Table( + 'perps_market_proxy_event_collateral_configuration_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + collateralId: Column(Types.String(), {nullable: false}), + maxCollateralAmount: Column(Types.String(), {nullable: false}), + upperLimitDiscount: Column(Types.String(), {nullable: false}), + lowerLimitDiscount: Column(Types.String(), {nullable: false}), + discountScalar: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventCollateralLiquidateRewardRatioSet = new Table( + 'perps_market_proxy_event_collateral_liquidate_reward_ratio_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + collateralLiquidateRewardRatioD18: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventRewardDistributorRegistered = new Table( + 'perps_market_proxy_event_reward_distributor_registered.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + distributor: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFeeCollectorSet = new Table( + 'perps_market_proxy_event_fee_collector_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feeCollector: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventInterestRateParametersSet = new Table( + 'perps_market_proxy_event_interest_rate_parameters_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + lowUtilizationInterestRateGradient: Column(Types.String(), {nullable: false}), + interestRateGradientBreakpoint: Column(Types.String(), {nullable: false}), + highUtilizationInterestRateGradient: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventKeeperCostNodeIdUpdated = new Table( + 'perps_market_proxy_event_keeper_cost_node_id_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + keeperCostNodeId: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventKeeperRewardGuardsSet = new Table( + 'perps_market_proxy_event_keeper_reward_guards_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + minKeeperRewardUsd: Column(Types.String(), {nullable: false}), + minKeeperProfitRatioD18: Column(Types.String(), {nullable: false}), + maxKeeperRewardUsd: Column(Types.String(), {nullable: false}), + maxKeeperScalingRatioD18: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventPerAccountCapsSet = new Table( + 'perps_market_proxy_event_per_account_caps_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + maxPositionsPerAccount: Column(Types.String(), {nullable: false}), + maxCollateralsPerAccount: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventReferrerShareUpdated = new Table( + 'perps_market_proxy_event_referrer_share_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + referrer: Column(Types.String(), {nullable: false}), + shareRatioD18: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsAccountProxyEventOwnerChanged = new Table( + 'perps_account_proxy_event_owner_changed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + oldOwner: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsAccountProxyEventOwnerNominated = new Table( + 'perps_account_proxy_event_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsAccountProxyEventUpgraded = new Table( + 'perps_account_proxy_event_upgraded.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + self: Column(Types.String(), {nullable: false}), + implementation: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsAccountProxyEventApproval = new Table( + 'perps_account_proxy_event_approval.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + approved: Column(Types.String(), {nullable: false}), + tokenId: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsAccountProxyEventApprovalForAll = new Table( + 'perps_account_proxy_event_approval_for_all.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + operator: Column(Types.String(), {nullable: false}), + approved: Column(Types.Boolean(), {nullable: false}), + } +) + +export let PerpsAccountProxyEventTransfer = new Table( + 'perps_account_proxy_event_transfer.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + from: Column(Types.String(), {nullable: false}), + to: Column(Types.String(), {nullable: false}), + tokenId: Column(Types.String(), {nullable: false}), + } +) diff --git a/indexers/arbitrum-sepolia/src/table.ts-e b/indexers/arbitrum-sepolia/src/table.ts-e new file mode 100644 index 00000000..e34aba5e --- /dev/null +++ b/indexers/arbitrum-sepolia/src/table.ts-e @@ -0,0 +1,2284 @@ +import {Table, Types, Column} from '@subsquid/file-store-parquet' + +export let Block = new Table( + 'block.parquet', + { + id: Column(Types.String(), {nullable: false}), + number: Column(Types.Int64(), {nullable: false}), + timestamp: Column(Types.Timestamp(), {nullable: false}), + } +) + +export let Transaction = new Table( + 'transaction.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: true}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + hash: Column(Types.String(), {nullable: false}), + to: Column(Types.String(), {nullable: true}), + from: Column(Types.String(), {nullable: true}), + status: Column(Types.Int64(), {nullable: true}), + } +) + +export let CoreProxyEventOwnerChanged = new Table( + 'core_proxy_event_owner_changed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + oldOwner: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventOwnerNominated = new Table( + 'core_proxy_event_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventUpgraded = new Table( + 'core_proxy_event_upgraded.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + self: Column(Types.String(), {nullable: false}), + implementation: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventFeatureFlagAllowAllSet = new Table( + 'core_proxy_event_feature_flag_allow_all_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + allowAll: Column(Types.Boolean(), {nullable: false}), + } +) + +export let CoreProxyEventFeatureFlagAllowlistAdded = new Table( + 'core_proxy_event_feature_flag_allowlist_added.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + account: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventFeatureFlagAllowlistRemoved = new Table( + 'core_proxy_event_feature_flag_allowlist_removed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + account: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventFeatureFlagDeniersReset = new Table( + 'core_proxy_event_feature_flag_deniers_reset.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + deniers: Column(Types.JSON(), {nullable: false}), + } +) + +export let CoreProxyEventFeatureFlagDenyAllSet = new Table( + 'core_proxy_event_feature_flag_deny_all_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + denyAll: Column(Types.Boolean(), {nullable: false}), + } +) + +export let CoreProxyEventAccountCreated = new Table( + 'core_proxy_event_account_created.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPermissionGranted = new Table( + 'core_proxy_event_permission_granted.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + permission: Column(Types.String(), {nullable: false}), + user: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPermissionRevoked = new Table( + 'core_proxy_event_permission_revoked.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + permission: Column(Types.String(), {nullable: false}), + user: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventDebtAssociated = new Table( + 'core_proxy_event_debt_associated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + amount: Column(Types.Decimal(38), {nullable: false}), + updatedDebt: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventAssociatedSystemSet = new Table( + 'core_proxy_event_associated_system_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + kind: Column(Types.String(), {nullable: false}), + id0: Column(Types.String(), {nullable: false}), + proxy: Column(Types.String(), {nullable: false}), + impl: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventCollateralLockCreated = new Table( + 'core_proxy_event_collateral_lock_created.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + tokenAmount: Column(Types.Decimal(38), {nullable: false}), + expireTimestamp: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventCollateralLockExpired = new Table( + 'core_proxy_event_collateral_lock_expired.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + tokenAmount: Column(Types.Decimal(38), {nullable: false}), + expireTimestamp: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventDeposited = new Table( + 'core_proxy_event_deposited.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + tokenAmount: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventWithdrawn = new Table( + 'core_proxy_event_withdrawn.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + tokenAmount: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventCollateralConfigured = new Table( + 'core_proxy_event_collateral_configured.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + config: Column(Types.JSON(), {nullable: false}), + } +) + +export let CoreProxyEventTransferCrossChainInitiated = new Table( + 'core_proxy_event_transfer_cross_chain_initiated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + destChainId: Column(Types.Decimal(38), {nullable: false}), + amount: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventIssuanceFeePaid = new Table( + 'core_proxy_event_issuance_fee_paid.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + feeAmount: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventUsdBurned = new Table( + 'core_proxy_event_usd_burned.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + amount: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventUsdMinted = new Table( + 'core_proxy_event_usd_minted.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + amount: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventLiquidation = new Table( + 'core_proxy_event_liquidation.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + liquidationData: Column(Types.JSON(), {nullable: false}), + liquidateAsAccountId: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventVaultLiquidation = new Table( + 'core_proxy_event_vault_liquidation.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + liquidationData: Column(Types.JSON(), {nullable: false}), + liquidateAsAccountId: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventMarketCollateralDeposited = new Table( + 'core_proxy_event_market_collateral_deposited.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + tokenAmount: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + creditCapacity: Column(Types.Decimal(38), {nullable: false}), + netIssuance: Column(Types.Decimal(38), {nullable: false}), + depositedCollateralValue: Column(Types.Decimal(38), {nullable: false}), + reportedDebt: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventMarketCollateralWithdrawn = new Table( + 'core_proxy_event_market_collateral_withdrawn.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + tokenAmount: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + creditCapacity: Column(Types.Decimal(38), {nullable: false}), + netIssuance: Column(Types.Decimal(38), {nullable: false}), + depositedCollateralValue: Column(Types.Decimal(38), {nullable: false}), + reportedDebt: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventMaximumMarketCollateralConfigured = new Table( + 'core_proxy_event_maximum_market_collateral_configured.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + systemAmount: Column(Types.Decimal(38), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventMarketRegistered = new Table( + 'core_proxy_event_market_registered.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + market: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventMarketSystemFeePaid = new Table( + 'core_proxy_event_market_system_fee_paid.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + feeAmount: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventMarketUsdDeposited = new Table( + 'core_proxy_event_market_usd_deposited.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + target: Column(Types.String(), {nullable: false}), + amount: Column(Types.Decimal(38), {nullable: false}), + market: Column(Types.String(), {nullable: false}), + creditCapacity: Column(Types.Decimal(38), {nullable: false}), + netIssuance: Column(Types.Decimal(38), {nullable: false}), + depositedCollateralValue: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventMarketUsdWithdrawn = new Table( + 'core_proxy_event_market_usd_withdrawn.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + target: Column(Types.String(), {nullable: false}), + amount: Column(Types.Decimal(38), {nullable: false}), + market: Column(Types.String(), {nullable: false}), + creditCapacity: Column(Types.Decimal(38), {nullable: false}), + netIssuance: Column(Types.Decimal(38), {nullable: false}), + depositedCollateralValue: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventSetMarketMinLiquidityRatio = new Table( + 'core_proxy_event_set_market_min_liquidity_ratio.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + minLiquidityRatio: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventSetMinDelegateTime = new Table( + 'core_proxy_event_set_min_delegate_time.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + minDelegateTime: Column(Types.Int64(), {nullable: false}), + } +) + +export let CoreProxyEventPoolApprovedAdded = new Table( + 'core_proxy_event_pool_approved_added.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventPoolApprovedRemoved = new Table( + 'core_proxy_event_pool_approved_removed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventPreferredPoolSet = new Table( + 'core_proxy_event_preferred_pool_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventPoolCollateralConfigurationUpdated = new Table( + 'core_proxy_event_pool_collateral_configuration_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + config: Column(Types.JSON(), {nullable: false}), + } +) + +export let CoreProxyEventPoolCollateralDisabledByDefaultSet = new Table( + 'core_proxy_event_pool_collateral_disabled_by_default_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + disabled: Column(Types.Boolean(), {nullable: false}), + } +) + +export let CoreProxyEventPoolConfigurationSet = new Table( + 'core_proxy_event_pool_configuration_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + markets: Column(Types.JSON(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolCreated = new Table( + 'core_proxy_event_pool_created.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolNameUpdated = new Table( + 'core_proxy_event_pool_name_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + name: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolNominationRenounced = new Table( + 'core_proxy_event_pool_nomination_renounced.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolNominationRevoked = new Table( + 'core_proxy_event_pool_nomination_revoked.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolOwnerNominated = new Table( + 'core_proxy_event_pool_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + nominatedOwner: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolOwnershipAccepted = new Table( + 'core_proxy_event_pool_ownership_accepted.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventPoolOwnershipRenounced = new Table( + 'core_proxy_event_pool_ownership_renounced.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventSetMinLiquidityRatio = new Table( + 'core_proxy_event_set_min_liquidity_ratio.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + minLiquidityRatio: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventRewardsClaimed = new Table( + 'core_proxy_event_rewards_claimed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + distributor: Column(Types.String(), {nullable: false}), + amount: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventRewardsDistributed = new Table( + 'core_proxy_event_rewards_distributed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + distributor: Column(Types.String(), {nullable: false}), + amount: Column(Types.Decimal(38), {nullable: false}), + start: Column(Types.Decimal(38), {nullable: false}), + duration: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventRewardsDistributorRegistered = new Table( + 'core_proxy_event_rewards_distributor_registered.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + distributor: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventRewardsDistributorRemoved = new Table( + 'core_proxy_event_rewards_distributor_removed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + distributor: Column(Types.String(), {nullable: false}), + } +) + +export let CoreProxyEventNewSupportedCrossChainNetwork = new Table( + 'core_proxy_event_new_supported_cross_chain_network.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + newChainId: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let CoreProxyEventDelegationUpdated = new Table( + 'core_proxy_event_delegation_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + poolId: Column(Types.Decimal(38), {nullable: false}), + collateralType: Column(Types.String(), {nullable: false}), + amount: Column(Types.Decimal(38), {nullable: false}), + leverage: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let AccountProxyEventOwnerChanged = new Table( + 'account_proxy_event_owner_changed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + oldOwner: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let AccountProxyEventOwnerNominated = new Table( + 'account_proxy_event_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let AccountProxyEventUpgraded = new Table( + 'account_proxy_event_upgraded.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + self: Column(Types.String(), {nullable: false}), + implementation: Column(Types.String(), {nullable: false}), + } +) + +export let AccountProxyEventApproval = new Table( + 'account_proxy_event_approval.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + approved: Column(Types.String(), {nullable: false}), + tokenId: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let AccountProxyEventApprovalForAll = new Table( + 'account_proxy_event_approval_for_all.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + operator: Column(Types.String(), {nullable: false}), + approved: Column(Types.Boolean(), {nullable: false}), + } +) + +export let AccountProxyEventTransfer = new Table( + 'account_proxy_event_transfer.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + from: Column(Types.String(), {nullable: false}), + to: Column(Types.String(), {nullable: false}), + tokenId: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventOwnerChanged = new Table( + 'spot_market_proxy_event_owner_changed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + oldOwner: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventOwnerNominated = new Table( + 'spot_market_proxy_event_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventUpgraded = new Table( + 'spot_market_proxy_event_upgraded.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + self: Column(Types.String(), {nullable: false}), + implementation: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventAssociatedSystemSet = new Table( + 'spot_market_proxy_event_associated_system_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + kind: Column(Types.String(), {nullable: false}), + id0: Column(Types.String(), {nullable: false}), + proxy: Column(Types.String(), {nullable: false}), + impl: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventDecayRateUpdated = new Table( + 'spot_market_proxy_event_decay_rate_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + rate: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventMarketNominationRenounced = new Table( + 'spot_market_proxy_event_market_nomination_renounced.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + nominee: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventMarketOwnerChanged = new Table( + 'spot_market_proxy_event_market_owner_changed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + oldOwner: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventMarketOwnerNominated = new Table( + 'spot_market_proxy_event_market_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthImplementationSet = new Table( + 'spot_market_proxy_event_synth_implementation_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthImplementation: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthImplementationUpgraded = new Table( + 'spot_market_proxy_event_synth_implementation_upgraded.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + proxy: Column(Types.String(), {nullable: false}), + implementation: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthPriceDataUpdated = new Table( + 'spot_market_proxy_event_synth_price_data_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + buyFeedId: Column(Types.String(), {nullable: false}), + sellFeedId: Column(Types.String(), {nullable: false}), + strictStalenessTolerance: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthRegistered = new Table( + 'spot_market_proxy_event_synth_registered.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + synthTokenAddress: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthetixSystemSet = new Table( + 'spot_market_proxy_event_synthetix_system_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthetix: Column(Types.String(), {nullable: false}), + usdTokenAddress: Column(Types.String(), {nullable: false}), + oracleManager: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthBought = new Table( + 'spot_market_proxy_event_synth_bought.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + synthReturned: Column(Types.Decimal(38), {nullable: false}), + fees: Column(Types.JSON(), {nullable: false}), + collectedFees: Column(Types.Decimal(38), {nullable: false}), + referrer: Column(Types.String(), {nullable: false}), + price: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthSold = new Table( + 'spot_market_proxy_event_synth_sold.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + amountReturned: Column(Types.Decimal(38), {nullable: false}), + fees: Column(Types.JSON(), {nullable: false}), + collectedFees: Column(Types.Decimal(38), {nullable: false}), + referrer: Column(Types.String(), {nullable: false}), + price: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventOrderCancelled = new Table( + 'spot_market_proxy_event_order_cancelled.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + asyncOrderId: Column(Types.Decimal(38), {nullable: false}), + asyncOrderClaim: Column(Types.JSON(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventOrderCommitted = new Table( + 'spot_market_proxy_event_order_committed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + orderType: Column(Types.Int64(), {nullable: false}), + amountProvided: Column(Types.Decimal(38), {nullable: false}), + asyncOrderId: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + referrer: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventOrderSettled = new Table( + 'spot_market_proxy_event_order_settled.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + asyncOrderId: Column(Types.Decimal(38), {nullable: false}), + finalOrderAmount: Column(Types.Decimal(38), {nullable: false}), + fees: Column(Types.JSON(), {nullable: false}), + collectedFees: Column(Types.Decimal(38), {nullable: false}), + settler: Column(Types.String(), {nullable: false}), + price: Column(Types.Decimal(38), {nullable: false}), + orderType: Column(Types.Int64(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSettlementStrategyAdded = new Table( + 'spot_market_proxy_event_settlement_strategy_added.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + strategyId: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventSettlementStrategySet = new Table( + 'spot_market_proxy_event_settlement_strategy_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + strategyId: Column(Types.Decimal(38), {nullable: false}), + strategy: Column(Types.JSON(), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthUnwrapped = new Table( + 'spot_market_proxy_event_synth_unwrapped.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + amountUnwrapped: Column(Types.Decimal(38), {nullable: false}), + fees: Column(Types.JSON(), {nullable: false}), + feesCollected: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventSynthWrapped = new Table( + 'spot_market_proxy_event_synth_wrapped.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + amountWrapped: Column(Types.Decimal(38), {nullable: false}), + fees: Column(Types.JSON(), {nullable: false}), + feesCollected: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventWrapperSet = new Table( + 'spot_market_proxy_event_wrapper_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + wrapCollateralType: Column(Types.String(), {nullable: false}), + maxWrappableAmount: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventAsyncFixedFeeSet = new Table( + 'spot_market_proxy_event_async_fixed_fee_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + asyncFixedFee: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventAtomicFixedFeeSet = new Table( + 'spot_market_proxy_event_atomic_fixed_fee_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + atomicFixedFee: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventCollateralLeverageSet = new Table( + 'spot_market_proxy_event_collateral_leverage_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + collateralLeverage: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventFeeCollectorSet = new Table( + 'spot_market_proxy_event_fee_collector_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + feeCollector: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventMarketSkewScaleSet = new Table( + 'spot_market_proxy_event_market_skew_scale_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + skewScale: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventMarketUtilizationFeesSet = new Table( + 'spot_market_proxy_event_market_utilization_fees_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + utilizationFeeRate: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventReferrerShareUpdated = new Table( + 'spot_market_proxy_event_referrer_share_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + referrer: Column(Types.String(), {nullable: false}), + sharePercentage: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventTransactorFixedFeeSet = new Table( + 'spot_market_proxy_event_transactor_fixed_fee_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + transactor: Column(Types.String(), {nullable: false}), + fixedFeeAmount: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventWrapperFeesSet = new Table( + 'spot_market_proxy_event_wrapper_fees_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + synthMarketId: Column(Types.Decimal(38), {nullable: false}), + wrapFee: Column(Types.Decimal(38), {nullable: false}), + unwrapFee: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let SpotMarketProxyEventFeatureFlagAllowAllSet = new Table( + 'spot_market_proxy_event_feature_flag_allow_all_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + allowAll: Column(Types.Boolean(), {nullable: false}), + } +) + +export let SpotMarketProxyEventFeatureFlagAllowlistAdded = new Table( + 'spot_market_proxy_event_feature_flag_allowlist_added.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + account: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventFeatureFlagAllowlistRemoved = new Table( + 'spot_market_proxy_event_feature_flag_allowlist_removed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + account: Column(Types.String(), {nullable: false}), + } +) + +export let SpotMarketProxyEventFeatureFlagDeniersReset = new Table( + 'spot_market_proxy_event_feature_flag_deniers_reset.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + deniers: Column(Types.JSON(), {nullable: false}), + } +) + +export let SpotMarketProxyEventFeatureFlagDenyAllSet = new Table( + 'spot_market_proxy_event_feature_flag_deny_all_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + denyAll: Column(Types.Boolean(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventAccountCreated = new Table( + 'perps_market_proxy_event_account_created.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventPermissionGranted = new Table( + 'perps_market_proxy_event_permission_granted.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + permission: Column(Types.String(), {nullable: false}), + user: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventPermissionRevoked = new Table( + 'perps_market_proxy_event_permission_revoked.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + permission: Column(Types.String(), {nullable: false}), + user: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventAssociatedSystemSet = new Table( + 'perps_market_proxy_event_associated_system_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + kind: Column(Types.String(), {nullable: false}), + id0: Column(Types.String(), {nullable: false}), + proxy: Column(Types.String(), {nullable: false}), + impl: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventOwnerChanged = new Table( + 'perps_market_proxy_event_owner_changed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + oldOwner: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventOwnerNominated = new Table( + 'perps_market_proxy_event_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventUpgraded = new Table( + 'perps_market_proxy_event_upgraded.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + self: Column(Types.String(), {nullable: false}), + implementation: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFactoryInitialized = new Table( + 'perps_market_proxy_event_factory_initialized.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + globalPerpsMarketId: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventMarketCreated = new Table( + 'perps_market_proxy_event_market_created.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + perpsMarketId: Column(Types.Decimal(38), {nullable: false}), + marketName: Column(Types.String(), {nullable: false}), + marketSymbol: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventCollateralModified = new Table( + 'perps_market_proxy_event_collateral_modified.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + collateralId: Column(Types.Decimal(38), {nullable: false}), + amountDelta: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventDebtPaid = new Table( + 'perps_market_proxy_event_debt_paid.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + amount: Column(Types.Decimal(38), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventInterestRateUpdated = new Table( + 'perps_market_proxy_event_interest_rate_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + superMarketId: Column(Types.Decimal(38), {nullable: false}), + interestRate: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventOrderCommitted = new Table( + 'perps_market_proxy_event_order_committed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + orderType: Column(Types.Int64(), {nullable: false}), + sizeDelta: Column(Types.Decimal(38), {nullable: false}), + acceptablePrice: Column(Types.Decimal(38), {nullable: false}), + commitmentTime: Column(Types.Decimal(38), {nullable: false}), + expectedPriceTime: Column(Types.Decimal(38), {nullable: false}), + settlementTime: Column(Types.Decimal(38), {nullable: false}), + expirationTime: Column(Types.Decimal(38), {nullable: false}), + trackingCode: Column(Types.String(), {nullable: false}), + sender: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventPreviousOrderExpired = new Table( + 'perps_market_proxy_event_previous_order_expired.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + sizeDelta: Column(Types.Decimal(38), {nullable: false}), + acceptablePrice: Column(Types.Decimal(38), {nullable: false}), + commitmentTime: Column(Types.Decimal(38), {nullable: false}), + trackingCode: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventAccountCharged = new Table( + 'perps_market_proxy_event_account_charged.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + amount: Column(Types.Decimal(38), {nullable: false}), + accountDebt: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventInterestCharged = new Table( + 'perps_market_proxy_event_interest_charged.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + interest: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventMarketUpdated = new Table( + 'perps_market_proxy_event_market_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + price: Column(Types.Decimal(38), {nullable: false}), + skew: Column(Types.Decimal(38), {nullable: false}), + size: Column(Types.Decimal(38), {nullable: false}), + sizeDelta: Column(Types.Decimal(38), {nullable: false}), + currentFundingRate: Column(Types.Decimal(38), {nullable: false}), + currentFundingVelocity: Column(Types.Decimal(38), {nullable: false}), + interestRate: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventOrderSettled = new Table( + 'perps_market_proxy_event_order_settled.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + fillPrice: Column(Types.Decimal(38), {nullable: false}), + pnl: Column(Types.Decimal(38), {nullable: false}), + accruedFunding: Column(Types.Decimal(38), {nullable: false}), + sizeDelta: Column(Types.Decimal(38), {nullable: false}), + newSize: Column(Types.Decimal(38), {nullable: false}), + totalFees: Column(Types.Decimal(38), {nullable: false}), + referralFees: Column(Types.Decimal(38), {nullable: false}), + collectedFees: Column(Types.Decimal(38), {nullable: false}), + settlementReward: Column(Types.Decimal(38), {nullable: false}), + trackingCode: Column(Types.String(), {nullable: false}), + settler: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventOrderCancelled = new Table( + 'perps_market_proxy_event_order_cancelled.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + desiredPrice: Column(Types.Decimal(38), {nullable: false}), + fillPrice: Column(Types.Decimal(38), {nullable: false}), + sizeDelta: Column(Types.Decimal(38), {nullable: false}), + settlementReward: Column(Types.Decimal(38), {nullable: false}), + trackingCode: Column(Types.String(), {nullable: false}), + settler: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFeatureFlagAllowAllSet = new Table( + 'perps_market_proxy_event_feature_flag_allow_all_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + allowAll: Column(Types.Boolean(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFeatureFlagAllowlistAdded = new Table( + 'perps_market_proxy_event_feature_flag_allowlist_added.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + account: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFeatureFlagAllowlistRemoved = new Table( + 'perps_market_proxy_event_feature_flag_allowlist_removed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + account: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFeatureFlagDeniersReset = new Table( + 'perps_market_proxy_event_feature_flag_deniers_reset.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + deniers: Column(Types.JSON(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFeatureFlagDenyAllSet = new Table( + 'perps_market_proxy_event_feature_flag_deny_all_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feature: Column(Types.String(), {nullable: false}), + denyAll: Column(Types.Boolean(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventAccountFlaggedForLiquidation = new Table( + 'perps_market_proxy_event_account_flagged_for_liquidation.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + availableMargin: Column(Types.Decimal(38), {nullable: false}), + requiredMaintenanceMargin: Column(Types.Decimal(38), {nullable: false}), + liquidationReward: Column(Types.Decimal(38), {nullable: false}), + flagReward: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventAccountLiquidationAttempt = new Table( + 'perps_market_proxy_event_account_liquidation_attempt.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + reward: Column(Types.Decimal(38), {nullable: false}), + fullLiquidation: Column(Types.Boolean(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventAccountMarginLiquidation = new Table( + 'perps_market_proxy_event_account_margin_liquidation.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + seizedMarginValue: Column(Types.Decimal(38), {nullable: false}), + liquidationReward: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventPositionLiquidated = new Table( + 'perps_market_proxy_event_position_liquidated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + accountId: Column(Types.Decimal(38), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + amountLiquidated: Column(Types.Decimal(38), {nullable: false}), + currentPositionSize: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFundingParametersSet = new Table( + 'perps_market_proxy_event_funding_parameters_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + skewScale: Column(Types.Decimal(38), {nullable: false}), + maxFundingVelocity: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventLiquidationParametersSet = new Table( + 'perps_market_proxy_event_liquidation_parameters_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + initialMarginRatioD18: Column(Types.Decimal(38), {nullable: false}), + maintenanceMarginRatioD18: Column(Types.Decimal(38), {nullable: false}), + minimumInitialMarginRatioD18: Column(Types.Decimal(38), {nullable: false}), + flagRewardRatioD18: Column(Types.Decimal(38), {nullable: false}), + minimumPositionMargin: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventLockedOiRatioSet = new Table( + 'perps_market_proxy_event_locked_oi_ratio_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + lockedOiRatioD18: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventMarketPriceDataUpdated = new Table( + 'perps_market_proxy_event_market_price_data_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + feedId: Column(Types.String(), {nullable: false}), + strictStalenessTolerance: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventMaxLiquidationParametersSet = new Table( + 'perps_market_proxy_event_max_liquidation_parameters_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + maxLiquidationLimitAccumulationMultiplier: Column(Types.Decimal(38), {nullable: false}), + maxSecondsInLiquidationWindow: Column(Types.Decimal(38), {nullable: false}), + maxLiquidationPd: Column(Types.Decimal(38), {nullable: false}), + endorsedLiquidator: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventMaxMarketSizeSet = new Table( + 'perps_market_proxy_event_max_market_size_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + maxMarketSize: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventMaxMarketValueSet = new Table( + 'perps_market_proxy_event_max_market_value_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + maxMarketValue: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventOrderFeesSet = new Table( + 'perps_market_proxy_event_order_fees_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + makerFeeRatio: Column(Types.Decimal(38), {nullable: false}), + takerFeeRatio: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventSettlementStrategyAdded = new Table( + 'perps_market_proxy_event_settlement_strategy_added.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + strategy: Column(Types.JSON(), {nullable: false}), + strategyId: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventSettlementStrategySet = new Table( + 'perps_market_proxy_event_settlement_strategy_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + marketId: Column(Types.Decimal(38), {nullable: false}), + strategyId: Column(Types.Decimal(38), {nullable: false}), + strategy: Column(Types.JSON(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventCollateralConfigurationSet = new Table( + 'perps_market_proxy_event_collateral_configuration_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + collateralId: Column(Types.Decimal(38), {nullable: false}), + maxCollateralAmount: Column(Types.Decimal(38), {nullable: false}), + upperLimitDiscount: Column(Types.Decimal(38), {nullable: false}), + lowerLimitDiscount: Column(Types.Decimal(38), {nullable: false}), + discountScalar: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventCollateralLiquidateRewardRatioSet = new Table( + 'perps_market_proxy_event_collateral_liquidate_reward_ratio_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + collateralLiquidateRewardRatioD18: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventRewardDistributorRegistered = new Table( + 'perps_market_proxy_event_reward_distributor_registered.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + distributor: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventFeeCollectorSet = new Table( + 'perps_market_proxy_event_fee_collector_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + feeCollector: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventInterestRateParametersSet = new Table( + 'perps_market_proxy_event_interest_rate_parameters_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + lowUtilizationInterestRateGradient: Column(Types.Decimal(38), {nullable: false}), + interestRateGradientBreakpoint: Column(Types.Decimal(38), {nullable: false}), + highUtilizationInterestRateGradient: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventKeeperCostNodeIdUpdated = new Table( + 'perps_market_proxy_event_keeper_cost_node_id_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + keeperCostNodeId: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsMarketProxyEventKeeperRewardGuardsSet = new Table( + 'perps_market_proxy_event_keeper_reward_guards_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + minKeeperRewardUsd: Column(Types.Decimal(38), {nullable: false}), + minKeeperProfitRatioD18: Column(Types.Decimal(38), {nullable: false}), + maxKeeperRewardUsd: Column(Types.Decimal(38), {nullable: false}), + maxKeeperScalingRatioD18: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventPerAccountCapsSet = new Table( + 'perps_market_proxy_event_per_account_caps_set.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + maxPositionsPerAccount: Column(Types.Decimal(38), {nullable: false}), + maxCollateralsPerAccount: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsMarketProxyEventReferrerShareUpdated = new Table( + 'perps_market_proxy_event_referrer_share_updated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + referrer: Column(Types.String(), {nullable: false}), + shareRatioD18: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsAccountProxyEventOwnerChanged = new Table( + 'perps_account_proxy_event_owner_changed.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + oldOwner: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsAccountProxyEventOwnerNominated = new Table( + 'perps_account_proxy_event_owner_nominated.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + newOwner: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsAccountProxyEventUpgraded = new Table( + 'perps_account_proxy_event_upgraded.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + self: Column(Types.String(), {nullable: false}), + implementation: Column(Types.String(), {nullable: false}), + } +) + +export let PerpsAccountProxyEventApproval = new Table( + 'perps_account_proxy_event_approval.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + approved: Column(Types.String(), {nullable: false}), + tokenId: Column(Types.Decimal(38), {nullable: false}), + } +) + +export let PerpsAccountProxyEventApprovalForAll = new Table( + 'perps_account_proxy_event_approval_for_all.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + owner: Column(Types.String(), {nullable: false}), + operator: Column(Types.String(), {nullable: false}), + approved: Column(Types.Boolean(), {nullable: false}), + } +) + +export let PerpsAccountProxyEventTransfer = new Table( + 'perps_account_proxy_event_transfer.parquet', + { + id: Column(Types.String(), {nullable: false}), + blockNumber: Column(Types.Int64(), {nullable: false}), + blockTimestamp: Column(Types.Timestamp(), {nullable: false}), + transactionHash: Column(Types.String(), {nullable: false}), + contract: Column(Types.String(), {nullable: false}), + eventName: Column(Types.String(), {nullable: false}), + from: Column(Types.String(), {nullable: false}), + to: Column(Types.String(), {nullable: false}), + tokenId: Column(Types.Decimal(38), {nullable: false}), + } +) diff --git a/scheduler/Dockerfile b/scheduler/Dockerfile index 4d125400..55ac231c 100644 --- a/scheduler/Dockerfile +++ b/scheduler/Dockerfile @@ -15,6 +15,9 @@ ENV PATH="/home/airflow/venv/bin:$PATH" COPY transformers/requirements.txt /transformers_requirements.txt RUN pip install --no-cache-dir -r /transformers_requirements.txt +COPY clickhouse/requirements.txt /clickhouse_requirements.txt +RUN pip install --no-cache-dir -r /clickhouse_requirements.txt + ENV AIRFLOW__CORE__LOAD_EXAMPLES=False ENV AIRFLOW__WEBSERVER__RBAC=True diff --git a/scheduler/dags/v3_etl.py b/scheduler/dags/v3_etl.py index a16c3bb0..06f9d6fe 100644 --- a/scheduler/dags/v3_etl.py +++ b/scheduler/dags/v3_etl.py @@ -111,6 +111,15 @@ def create_dag(network, rpc_var, target="dev"): """, ) + clickhouse_import_task_id = f"clickhouse_import_{version}" + clickhouse_import_task = create_bash_operator( + dag=dag, + task_id=clickhouse_import_task_id, + command=f""" + source /home/airflow/venv/bin/activate && python /clickhouse/clickhouse_import.py --network {network} + """, + ) + transform_task_id = f"transform_{version}" transform_task = create_bash_operator( dag=dag, @@ -149,7 +158,13 @@ def create_dag(network, rpc_var, target="dev"): >> test_task ) else: - latest_only_task >> sync_repo_task >> transform_task >> test_task + ( + latest_only_task + >> sync_repo_task + >> clickhouse_import_task + >> transform_task + >> test_task + ) return dag diff --git a/transformers/requirements.txt b/transformers/requirements.txt index 0f44ee95..930ca224 100644 --- a/transformers/requirements.txt +++ b/transformers/requirements.txt @@ -2,4 +2,5 @@ pandas pyarrow psycopg2-binary dbt-postgres +dbt-clickhouse sqlfluff diff --git a/transformers/synthetix/macros/convert_case.sql b/transformers/synthetix/macros/convert_case.sql new file mode 100644 index 00000000..e2a04ddf --- /dev/null +++ b/transformers/synthetix/macros/convert_case.sql @@ -0,0 +1,7 @@ +{% macro convert_case(field) %} + {% set re = modules.re %} + {% set field_snake = re.sub('(? toDateTime(x), + range( + toUInt32(date_trunc('hour', min(t.ts))), + toUInt32(date_trunc('hour', max(t.ts))), + 3600 + ) + ) ) as ts from ( @@ -86,17 +91,14 @@ issuance as ( date_trunc( 'hour', ts - ) as ts, + ) as iss_ts, pool_id, collateral_type, sum(amount) as hourly_issuance from filt_issuance group by - date_trunc( - 'hour', - ts - ), + iss_ts, pool_id, collateral_type ) @@ -119,4 +121,4 @@ left join issuance as i ) = lower( i.collateral_type ) - and dim.ts = i.ts + and dim.ts = i.iss_ts diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/core/fct_pool_pnl_hourly_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/core/fct_pool_pnl_hourly_arbitrum_sepolia.sql index 4bc4b6e7..7ea8641a 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/core/fct_pool_pnl_hourly_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/core/fct_pool_pnl_hourly_arbitrum_sepolia.sql @@ -7,10 +7,15 @@ with dim as ( select p.pool_id, p.collateral_type, - generate_series( - date_trunc('hour', min(t.ts)), - date_trunc('hour', max(t.ts)), - '1 hour'::INTERVAL + arrayJoin( + arrayMap( + x -> toDateTime(x), + range( + toUInt32(date_trunc('hour', min(t.ts))), + toUInt32(date_trunc('hour', max(t.ts))), + 3600 + ) + ) ) as ts from ( @@ -77,16 +82,16 @@ collateral as ( from {{ ref('core_vault_collateral_arbitrum_sepolia') }} where - pool_id = 1 + pool_id = '1' ), ffill as ( select - dim.ts, - dim.pool_id, - dim.collateral_type, + dim.ts as ts, + dim.pool_id as pool_id, + dim.collateral_type as collateral_type, coalesce( - last(debt) over ( + last_value(debt) over ( partition by dim.collateral_type, dim.pool_id order by dim.ts rows between unbounded preceding and current row @@ -94,7 +99,7 @@ ffill as ( 0 ) as debt, coalesce( - last(collateral_value) over ( + last_value(collateral_value) over ( partition by dim.collateral_type, dim.pool_id order by dim.ts rows between unbounded preceding and current row @@ -122,10 +127,11 @@ hourly_pnl as ( collateral_type, collateral_value, debt, - coalesce(lag(debt) over ( + coalesce(lagInFrame(debt) over ( partition by pool_id, collateral_type order by ts + rows between unbounded preceding and unbounded following ) - debt, 0) as hourly_pnl from ffill @@ -143,11 +149,11 @@ hourly_rewards as ( hourly_returns as ( select - pnl.ts, - pnl.pool_id, - pnl.collateral_type, - pnl.collateral_value, - pnl.debt, + pnl.ts as ts, + pnl.pool_id as pool_id, + pnl.collateral_type as collateral_type, + pnl.collateral_value as collateral_value, + pnl.debt as debt, coalesce( iss.hourly_issuance, 0 diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/core/fct_pool_rewards_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/core/fct_pool_rewards_arbitrum_sepolia.sql index 64df6fe3..e921cd8c 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/core/fct_pool_rewards_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/core/fct_pool_rewards_arbitrum_sepolia.sql @@ -1,13 +1,11 @@ with rewards_distributed as ( select block_timestamp as ts, - CAST( - pool_id as INTEGER - ) as pool_id, + pool_id, collateral_type, distributor, {{ convert_wei('amount') }} as amount, - TO_TIMESTAMP("start") as ts_start, + FROM_UNIXTIME(CAST("start" AS INTEGER)) as ts_start, "duration" from {{ ref('core_rewards_distributed_arbitrum_sepolia') }} diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/core/fct_pool_rewards_token_hourly_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/core/fct_pool_rewards_token_hourly_arbitrum_sepolia.sql index 3cd4079f..af137f1f 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/core/fct_pool_rewards_token_hourly_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/core/fct_pool_rewards_token_hourly_arbitrum_sepolia.sql @@ -2,17 +2,22 @@ with dim as ( select m.pool_id, m.collateral_type, - generate_series( - date_trunc('hour', min(t.min_ts)), - date_trunc('hour', max(t.max_ts)), - '1 hour'::INTERVAL + arrayJoin( + arrayMap( + x -> toDateTime(x), + range( + toUInt32(date_trunc('hour', min(t.min_ts))), + toUInt32(date_trunc('hour', max(t.max_ts))), + 3600 + ) + ) ) as ts from ( select min(ts_start) as min_ts, max( - ts_start + "duration" * '1 second'::INTERVAL + ts_start + toIntervalSecond(cast("duration" as UInt256)) ) as max_ts from {{ ref('fct_pool_rewards_arbitrum_sepolia') }} @@ -38,7 +43,7 @@ rewards_distributed as ( token_symbol, amount, ts_start, - "duration" + cast("duration" as UInt256) as duration from {{ ref('fct_pool_rewards_arbitrum_sepolia') }} ), @@ -52,7 +57,7 @@ hourly_distributions as ( r.token_symbol, r.amount, r.ts_start, - r."duration", + r.duration, row_number() over ( partition by dim.ts, @@ -72,10 +77,10 @@ hourly_distributions as ( ) = lower( r.collateral_type ) - and dim.ts + '1 hour'::INTERVAL >= r.ts_start - and dim.ts < r.ts_start + r."duration" * '1 second'::INTERVAL + and dim.ts + toIntervalHour(1) >= r.ts_start + and dim.ts < r.ts_start + toIntervalSecond(cast(r.duration as UInt256)) where - r."duration" > 0 + r.duration > 0 ), streamed_rewards as ( @@ -90,26 +95,22 @@ streamed_rewards as ( -- convert the interval to a number of hours -- multiply the result by the hourly amount to get the amount distributed this hour ( - extract( - epoch - from + toFloat64( least( - d."duration" / 3600 * '1 hour'::INTERVAL, + d.duration / 3600, least( - d.ts + '1 hour'::INTERVAL - greatest( + d.ts + toIntervalHour(1) - greatest( d.ts, d.ts_start ), least( - d.ts_start + d."duration" * '1 second'::INTERVAL, - d.ts + '1 hour'::INTERVAL + d.ts_start + toIntervalSecond(d.duration), + d.ts + toIntervalHour(1) ) - d.ts ) ) - ) / 3600 - ) * d.amount / ( - d."duration" / 3600 - ) as amount + ) + * d.amount) / d.duration as amount from hourly_distributions as d where @@ -130,7 +131,7 @@ instant_rewards as ( from rewards_distributed where - "duration" = 0 + duration = 0 ), combined as ( @@ -140,7 +141,7 @@ combined as ( combo.collateral_type, combo.distributor, combo.token_symbol, - combo.amount, + combo.amount as amount_x, p.price from ( @@ -176,9 +177,9 @@ select collateral_type, distributor, token_symbol, - sum(amount) as amount, + sum(amount_x) as amount, sum( - amount * price + amount_x * price ) as rewards_usd from combined @@ -188,3 +189,4 @@ group by collateral_type, distributor, token_symbol +settings allow_experimental_join_condition = 1 \ No newline at end of file diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_account_stats_daily_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_account_stats_daily_arbitrum_sepolia.sql index db42b19d..f5c30abc 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_account_stats_daily_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_account_stats_daily_arbitrum_sepolia.sql @@ -3,7 +3,7 @@ with daily as ( DATE_TRUNC( 'day', ts - ) as ts, + ) as daily_ts, account_id, SUM(fees) as fees, SUM(volume) as volume, @@ -12,10 +12,7 @@ with daily as ( from {{ ref('fct_perp_account_stats_hourly_arbitrum_sepolia') }} group by - DATE_TRUNC( - 'day', - ts - ), + daily_ts, account_id ), @@ -25,14 +22,14 @@ stats as ( SUM(fees) over ( partition by account_id order by - ts + daily_ts range between unbounded preceding and current row ) as cumulative_fees, SUM(volume) over ( partition by account_id order by - ts + daily_ts range between unbounded preceding and current row ) as cumulative_volume diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_account_stats_hourly_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_account_stats_hourly_arbitrum_sepolia.sql index 8d80af43..336f656a 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_account_stats_hourly_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_account_stats_hourly_arbitrum_sepolia.sql @@ -38,7 +38,7 @@ inc_trades as ( DATE_TRUNC( 'hour', ts - ) as ts, + ) as trades_ts, account_id, SUM(trades) as trades, SUM(total_fees) as fees, @@ -48,10 +48,7 @@ inc_trades as ( from trades group by - DATE_TRUNC( - 'hour', - ts - ), + trades_ts, account_id ), @@ -60,23 +57,20 @@ inc_liq as ( DATE_TRUNC( 'hour', ts - ) as ts, + ) as liq_ts, account_id, SUM(amount_liquidated) as amount_liquidated, SUM(liquidations) as liquidations from liq group by - DATE_TRUNC( - 'hour', - ts - ), + liq_ts, account_id ), inc as ( select - h.ts, + h.trades_ts as ts, h.account_id, COALESCE( h.trades, @@ -110,7 +104,7 @@ inc as ( inc_trades as h left join inc_liq as l on - h.ts = l.ts + h.trades_ts = l.liq_ts and h.account_id = l.account_id ) diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_market_stats_daily_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_market_stats_daily_arbitrum_sepolia.sql index 190a3e0f..4c4dfb59 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_market_stats_daily_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_market_stats_daily_arbitrum_sepolia.sql @@ -1,25 +1,41 @@ +with daily as ( + select + DATE_TRUNC( + 'day', + ts + ) as daily_ts, + market_symbol, + SUM(trades) as trades, + SUM(exchange_fees) as exchange_fees, + SUM(referral_fees) as referral_fees, + SUM(collected_fees) as collected_fees, + SUM(volume) as volume, + SUM(amount_liquidated) as amount_liquidated, + SUM(liquidations) as liquidations, + MAX(cumulative_exchange_fees) as cumulative_exchange_fees, + MAX(cumulative_referral_fees) as cumulative_referral_fees, + MAX(cumulative_collected_fees) as cumulative_collected_fees, + MAX(cumulative_volume) as cumulative_volume + from + {{ ref('fct_perp_market_stats_hourly_arbitrum_sepolia') }} + group by + daily_ts, + market_symbol +) + select - DATE_TRUNC( - 'day', - ts - ) as ts, + daily_ts as ts, market_symbol, - SUM(trades) as trades, - SUM(exchange_fees) as exchange_fees, - SUM(referral_fees) as referral_fees, - SUM(collected_fees) as collected_fees, - SUM(volume) as volume, - SUM(amount_liquidated) as amount_liquidated, - SUM(liquidations) as liquidations, - MAX(cumulative_exchange_fees) as cumulative_exchange_fees, - MAX(cumulative_referral_fees) as cumulative_referral_fees, - MAX(cumulative_collected_fees) as cumulative_collected_fees, - MAX(cumulative_volume) as cumulative_volume + trades, + exchange_fees, + referral_fees, + collected_fees, + volume, + amount_liquidated, + liquidations, + cumulative_exchange_fees, + cumulative_referral_fees, + cumulative_collected_fees, + cumulative_volume from - {{ ref('fct_perp_market_stats_hourly_arbitrum_sepolia') }} -group by - DATE_TRUNC( - 'day', - ts - ), - market_symbol + daily diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_market_stats_hourly_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_market_stats_hourly_arbitrum_sepolia.sql index 472b7f80..4e0e08cf 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_market_stats_hourly_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_market_stats_hourly_arbitrum_sepolia.sql @@ -26,7 +26,7 @@ inc_trades as ( DATE_TRUNC( 'hour', ts - ) as ts, + ) as trades_ts, market_symbol, SUM(trades) as trades, SUM(exchange_fees) as exchange_fees, @@ -36,10 +36,7 @@ inc_trades as ( from trades group by - DATE_TRUNC( - 'hour', - ts - ), + trades_ts, market_symbol ), @@ -48,27 +45,29 @@ inc_liq as ( DATE_TRUNC( 'hour', ts - ) as ts, + ) as liq_ts, market_symbol, SUM(amount_liquidated) as amount_liquidated, SUM(liquidations) as liquidations from liq group by - DATE_TRUNC( - 'hour', - ts - ), + liq_ts, market_symbol ), dim as ( select m.market_symbol, - GENERATE_SERIES( - DATE_TRUNC('hour', MIN(t.ts)), - DATE_TRUNC('hour', MAX(t.ts)), - '1 hour'::INTERVAL + arrayJoin( + arrayMap( + x -> toDateTime(x), + range( + toUInt32(date_trunc('hour', min(t.ts))), + toUInt32(date_trunc('hour', max(t.ts))), + 3600 + ) + ) ) as ts from ( @@ -88,7 +87,7 @@ dim as ( inc as ( select dim.ts, - dim.market_symbol, + dim.market_symbol as market_symbol, COALESCE( h.trades, 0 @@ -149,11 +148,11 @@ inc as ( dim left join inc_trades as h on - dim.ts = h.ts + dim.ts = h.trades_ts and dim.market_symbol = h.market_symbol left join inc_liq as l on - dim.ts = l.ts + dim.ts = l.liq_ts and dim.market_symbol = l.market_symbol ) diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_stats_daily_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_stats_daily_arbitrum_sepolia.sql index b5556781..e809f14c 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_stats_daily_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_stats_daily_arbitrum_sepolia.sql @@ -1,23 +1,37 @@ +with daily as ( + select + DATE_TRUNC( + 'day', + ts + ) as daily_ts, + SUM(trades) as trades, + SUM(exchange_fees) as exchange_fees, + SUM(referral_fees) as referral_fees, + SUM(collected_fees) as collected_fees, + SUM(volume) as volume, + SUM(liquidation_rewards) as liquidation_rewards, + SUM(liquidated_accounts) as liquidated_accounts, + MAX(cumulative_exchange_fees) as cumulative_exchange_fees, + MAX(cumulative_referral_fees) as cumulative_referral_fees, + MAX(cumulative_collected_fees) as cumulative_collected_fees, + MAX(cumulative_volume) as cumulative_volume + from + {{ ref('fct_perp_stats_hourly_arbitrum_sepolia') }} + group by + daily_ts +) + select - DATE_TRUNC( - 'day', - ts - ) as ts, - SUM(trades) as trades, - SUM(exchange_fees) as exchange_fees, - SUM(referral_fees) as referral_fees, - SUM(collected_fees) as collected_fees, - SUM(volume) as volume, - SUM(liquidation_rewards) as liquidation_rewards, - SUM(liquidated_accounts) as liquidated_accounts, - MAX(cumulative_exchange_fees) as cumulative_exchange_fees, - MAX(cumulative_referral_fees) as cumulative_referral_fees, - MAX(cumulative_collected_fees) as cumulative_collected_fees, - MAX(cumulative_volume) as cumulative_volume -from - {{ ref('fct_perp_stats_hourly_arbitrum_sepolia') }} -group by - DATE_TRUNC( - 'day', - ts - ) + daily_ts as ts, + trades, + exchange_fees, + referral_fees, + collected_fees, + volume, + liquidation_rewards, + liquidated_accounts, + cumulative_exchange_fees, + cumulative_referral_fees, + cumulative_collected_fees, + cumulative_volume +from daily diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_stats_hourly_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_stats_hourly_arbitrum_sepolia.sql index 035db288..12a9e407 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_stats_hourly_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_stats_hourly_arbitrum_sepolia.sql @@ -30,16 +30,13 @@ inc_liq as ( DATE_TRUNC( 'hour', ts - ) as ts, + ) as liq_ts, SUM(total_reward) as liquidation_rewards, SUM(liquidated_accounts) as liquidated_accounts from liq group by - DATE_TRUNC( - 'hour', - ts - ) + liq_ts ), inc_trade as ( @@ -83,7 +80,7 @@ inc as ( from inc_trade as h left join inc_liq as l - on h.ts = l.ts + on h.ts = l.liq_ts ) select * diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_tracking_stats_daily_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_tracking_stats_daily_arbitrum_sepolia.sql index 242cbcc9..6564d414 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_tracking_stats_daily_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_tracking_stats_daily_arbitrum_sepolia.sql @@ -3,7 +3,7 @@ with trades as ( DATE_TRUNC( 'day', ts - ) as ts, + ) as trades_ts, tracking_code, SUM(exchange_fees) as exchange_fees, SUM(referral_fees) as referral_fees, @@ -13,10 +13,7 @@ with trades as ( from {{ ref('fct_perp_tracking_stats_hourly_arbitrum_sepolia') }} group by - DATE_TRUNC( - 'day', - ts - ), + trades_ts, tracking_code ), @@ -25,7 +22,7 @@ accounts as ( DATE_TRUNC( 'day', ts - ) as ts, + ) as accounts_ts, tracking_code, COUNT( distinct account_id @@ -33,16 +30,13 @@ accounts as ( from {{ ref('fct_perp_trades_arbitrum_sepolia') }} group by - DATE_TRUNC( - 'day', - ts - ), + accounts_ts, tracking_code ), total as ( select - ts, + trades_ts as total_ts, SUM(exchange_fees) as exchange_fees_total, SUM(referral_fees) as referral_fees_total, SUM(collected_fees) as collected_fees_total, @@ -51,11 +45,11 @@ total as ( from trades group by - ts + total_ts ) select - trades.ts, + trades.trades_ts as ts, trades.tracking_code, trades.exchange_fees, trades.referral_fees, @@ -87,7 +81,7 @@ from trades inner join accounts on - trades.ts = accounts.ts + trades.trades_ts = accounts.accounts_ts and trades.tracking_code = accounts.tracking_code inner join total - on trades.ts = total.ts + on trades.trades_ts = total.total_ts \ No newline at end of file diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_tracking_stats_hourly_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_tracking_stats_hourly_arbitrum_sepolia.sql index 81c623ac..584f04e2 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_tracking_stats_hourly_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/perp_stats/fct_perp_tracking_stats_hourly_arbitrum_sepolia.sql @@ -3,7 +3,7 @@ with trades as ( DATE_TRUNC( 'hour', ts - ) as ts, + ) as trades_ts, tracking_code, SUM(exchange_fees) as exchange_fees, SUM(referral_fees) as referral_fees, @@ -13,10 +13,7 @@ with trades as ( from {{ ref('fct_perp_trades_arbitrum_sepolia') }} group by - DATE_TRUNC( - 'hour', - ts - ), + trades_ts, tracking_code ), @@ -25,24 +22,21 @@ accounts as ( DATE_TRUNC( 'hour', ts - ) as ts, + ) as accounts_ts, tracking_code, COUNT( distinct account_id - ) as "accounts" + ) as accounts_x from {{ ref('fct_perp_trades_arbitrum_sepolia') }} group by - DATE_TRUNC( - 'hour', - ts - ), + accounts_ts, tracking_code ), total as ( select - ts, + trades_ts as total_ts, SUM(trades) as trades_total, SUM(exchange_fees) as exchange_fees_total, SUM(referral_fees) as referral_fees_total, @@ -51,18 +45,18 @@ total as ( from trades group by - ts + total_ts ) select - trades.ts, - trades.tracking_code, - trades.exchange_fees, - trades.referral_fees, - trades.collected_fees, - trades.volume, - trades.trades, - accounts.accounts, + trades.trades_ts as ts, + trades.tracking_code as tracking_code, + exchange_fees, + referral_fees, + collected_fees, + volume, + trades, + accounts_x, case when total.exchange_fees_total = 0 then 0 else trades.exchange_fees / total.exchange_fees_total @@ -87,7 +81,7 @@ from trades inner join accounts on - trades.ts = accounts.ts + trades.trades_ts = accounts.accounts_ts and trades.tracking_code = accounts.tracking_code inner join total - on trades.ts = total.ts + on trades.trades_ts = total.total_ts \ No newline at end of file diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/prices/fct_prices_hourly_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/prices/fct_prices_hourly_arbitrum_sepolia.sql index c7e7404f..6e20c765 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/prices/fct_prices_hourly_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/prices/fct_prices_hourly_arbitrum_sepolia.sql @@ -19,10 +19,15 @@ with prices as ( dim as ( select m.market_symbol, - GENERATE_SERIES( - DATE_TRUNC('hour', MIN(t.ts)), - DATE_TRUNC('hour', MAX(t.ts)), - '1 hour'::INTERVAL + arrayJoin( + arrayMap( + x -> toDateTime(x), + range( + toUInt32(date_trunc('hour', min(t.ts))), + toUInt32(date_trunc('hour', max(t.ts))), + 3600 + ) + ) ) as ts from ( @@ -43,7 +48,7 @@ ffill as ( select dim.ts, dim.market_symbol, - LAST(prices.price) over ( + LAST_VALUE(prices.price) over ( partition by dim.market_symbol order by dim.ts rows between unbounded preceding and current row diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/spot/fct_synth_supply_arbitrum_sepolia.sql b/transformers/synthetix/models/marts/arbitrum/sepolia/spot/fct_synth_supply_arbitrum_sepolia.sql index 7c0d89d5..4760edb7 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/spot/fct_synth_supply_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/spot/fct_synth_supply_arbitrum_sepolia.sql @@ -20,7 +20,7 @@ atomics as ( select ts, block_number, - 0 as synth_market_id, + '0' as synth_market_id, amount * price * -1 as change_amount from {{ ref('fct_spot_atomics_arbitrum_sepolia') }} @@ -30,7 +30,7 @@ usd_changes as ( select block_timestamp as ts, block_number, - 0 as synth_market_id, + '0' as synth_market_id, {{ convert_wei("amount") }} as change_amount from {{ ref('core_usd_minted_arbitrum_sepolia') }} @@ -38,7 +38,7 @@ usd_changes as ( select block_timestamp as ts, block_number, - 0 as synth_market_id, + '0' as synth_market_id, -1 * {{ convert_wei("amount") }} as change_amount from {{ ref('core_usd_burned_arbitrum_sepolia') }} diff --git a/transformers/synthetix/models/raw/arbitrum/sepolia/blocks_arbitrum_sepolia.sql b/transformers/synthetix/models/raw/arbitrum/sepolia/blocks_arbitrum_sepolia.sql index d350f78a..e99b8ef8 100644 --- a/transformers/synthetix/models/raw/arbitrum/sepolia/blocks_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/raw/arbitrum/sepolia/blocks_arbitrum_sepolia.sql @@ -13,14 +13,14 @@ with indexer_blocks as ( parquet_blocks as ( select - TO_TIMESTAMP(timestamp) as ts, + FROM_UNIXTIME(timestamp) as ts, CAST( block_number as INTEGER ) as block_number from {{ source( 'raw_arbitrum_sepolia', - 'blocks_parquet' + 'blocks' ) }} ), diff --git a/transformers/synthetix/models/raw/arbitrum/sepolia/core/core_rewards_claimed_arbitrum_sepolia.sql b/transformers/synthetix/models/raw/arbitrum/sepolia/core/core_rewards_claimed_arbitrum_sepolia.sql index 0f1d47b5..a5cc68b1 100644 --- a/transformers/synthetix/models/raw/arbitrum/sepolia/core/core_rewards_claimed_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/raw/arbitrum/sepolia/core/core_rewards_claimed_arbitrum_sepolia.sql @@ -1,6 +1,6 @@ {{ get_event_data( 'arbitrum', - 'mainnet', + 'sepolia', 'core_proxy', 'rewards_claimed' ) }} diff --git a/transformers/synthetix/models/raw/arbitrum/sepolia/core/core_vault_collateral_arbitrum_sepolia.sql b/transformers/synthetix/models/raw/arbitrum/sepolia/core/core_vault_collateral_arbitrum_sepolia.sql index 5c19fd03..8eb16295 100644 --- a/transformers/synthetix/models/raw/arbitrum/sepolia/core/core_vault_collateral_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/raw/arbitrum/sepolia/core/core_vault_collateral_arbitrum_sepolia.sql @@ -6,29 +6,27 @@ with base as ( pool_id, collateral_type, cast( - amount as numeric + amount as UInt256 ) as amount, cast( - value as numeric + value as UInt256 ) as collateral_value from {{ source( 'raw_arbitrum_sepolia', - "core_get_vault_collateral" + "get_vault_collateral" ) }} where amount is not null ) select - to_timestamp(blocks.timestamp) as ts, + from_unixtime(blocks.timestamp) as ts, cast( blocks.block_number as integer ) as block_number, base.contract_address, - cast( - base.pool_id as integer - ) as pool_id, + base.pool_id, cast( base.collateral_type as varchar ) as collateral_type, @@ -36,5 +34,5 @@ select {{ convert_wei('base.collateral_value') }} as collateral_value from base -inner join {{ source('raw_arbitrum_sepolia', 'blocks_parquet') }} as blocks +inner join {{ source('raw_arbitrum_sepolia', 'blocks') }} as blocks on base.block_number = blocks.block_number diff --git a/transformers/synthetix/models/raw/arbitrum/sepolia/core/core_vault_debt_arbitrum_sepolia.sql b/transformers/synthetix/models/raw/arbitrum/sepolia/core/core_vault_debt_arbitrum_sepolia.sql index 562dfc79..31515eda 100644 --- a/transformers/synthetix/models/raw/arbitrum/sepolia/core/core_vault_debt_arbitrum_sepolia.sql +++ b/transformers/synthetix/models/raw/arbitrum/sepolia/core/core_vault_debt_arbitrum_sepolia.sql @@ -6,31 +6,29 @@ with base as ( pool_id, collateral_type, cast( - value_1 as numeric + value_1 as Int256 ) as debt from {{ source( 'raw_arbitrum_sepolia', - "core_get_vault_debt" + "get_vault_debt" ) }} where value_1 is not null ) select - to_timestamp(blocks.timestamp) as ts, + from_unixtime(blocks.timestamp) as ts, cast( blocks.block_number as integer ) as block_number, base.contract_address, - cast( - base.pool_id as integer - ) as pool_id, + base.pool_id, cast( base.collateral_type as varchar ) as collateral_type, {{ convert_wei('base.debt') }} as debt from base -inner join {{ source('raw_arbitrum_sepolia', 'blocks_parquet') }} as blocks +inner join {{ source('raw_arbitrum_sepolia', 'blocks') }} as blocks on base.block_number = blocks.block_number diff --git a/transformers/synthetix/models/raw/sources.yml b/transformers/synthetix/models/raw/sources.yml index 1199aa4c..2855b44d 100644 --- a/transformers/synthetix/models/raw/sources.yml +++ b/transformers/synthetix/models/raw/sources.yml @@ -84,7 +84,7 @@ sources: - name: blocks_parquet - name: raw_arbitrum_sepolia - database: analytics + database: arbitrum_sepolia schema: raw_arbitrum_sepolia tables: - name: block @@ -129,9 +129,9 @@ sources: - name: core_proxy_event_market_usd_deposited - name: core_proxy_event_market_usd_withdrawn - - name: core_get_vault_collateral - - name: core_get_vault_debt - - name: blocks_parquet + - name: get_vault_collateral + - name: get_vault_debt + - name: blocks - name: raw_arbitrum_mainnet database: analytics diff --git a/transformers/synthetix/profiles/profiles.yml b/transformers/synthetix/profiles/profiles.yml index 9e1fde39..6008aa9f 100644 --- a/transformers/synthetix/profiles/profiles.yml +++ b/transformers/synthetix/profiles/profiles.yml @@ -1,3 +1,15 @@ +clickhouse: + target: dev + outputs: + dev: + type: clickhouse + schema: dev + host: clickhouse + port: 8123 + user: default + password: "" + dbname: default + synthetix: target: prod outputs: