This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -X POST -H "Content-Type: application/json" \ | |
| --data '{ | |
| "jsonrpc": "2.0", | |
| "method": "eth_call", | |
| "params": [ | |
| { | |
| "to": "0xcA11bde05977b3631167028862bE2a173976CA11", | |
| "data": "399542e9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005a0000000000000000000000000000000000000000000000000000000000000062000000000000000000000000000000000000000000000000000000000000006a0000000000000000000000000000000000000000000000000000000000000074000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000086000000000000000000000000000000000000000000000000000000000000008e000000000000000000000000000000000000000000000000000000000000009800000000000000000000000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import math | |
| from datetime import datetime, timedelta | |
| from decimal import Decimal | |
| from enum import Enum | |
| from typing import Collection, Mapping | |
| from uuid import UUID | |
| import pandas as pd | |
| from dataclasses_json.core import Json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # github.com/tradingstrategy-ai/web3-ethereum-defi | |
| from eth_defi.gmx.create_increase_order import IncreaseOrder | |
| from eth_defi.gmx.trading import GMXTrading | |
| from eth_defi.provider.multi_provider import create_multi_provider_web3 | |
| from eth_defi.gmx.config import GMXConfig | |
| from eth_defi.hotwallet import HotWallet | |
| from eth_account import Account | |
| import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| You can append data to a Parquet dataset in PyArrow by using the `pyarrow.parquet.write_to_dataset()` function and setting the `existing_data_behavior` parameter to `'overwrite_or_append'`. | |
| This function writes new Parquet files to the dataset directory. If the data belongs to a new partition, a new partition directory is created. If it belongs to an existing partition, a new file is added to that partition's directory. | |
| ----- | |
| ### \#\# How It Works | |
| The key is the `existing_data_behavior` argument, which tells PyArrow how to handle the new data in relation to any data already at the destination. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """A simple trade execution report database by using Python dataclass, Redis and JSON. | |
| - A very simple database for arbitrage trade execution reports. | |
| - Dataclasses are serialised and deserialised to JSON that is stored in the Redis. | |
| - There is type validation for members and class-types. | |
| - Class-types like Decimal are converted back to their original format upon deserialisation. | |
| - Optional members are supported and the member presence is validated. | |
| - Past trades can be iterated in either order by creation. | |
| - A simple CSV exported is provided. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """py.test fixtures for spinning up a WSGI server for functional test run.""" | |
| import threading | |
| import time | |
| from pyramid.router import Router | |
| from waitress import serve | |
| from urllib.parse import urlparse | |
| import pytest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Set up a founry for local development, using faster dev profile for compilation | |
| # | |
| PROFILE=dev | |
| # You need to delete the existing forge etc. commands, because even | |
| # if the cargo install says "replacing" they did not really seem to replace and | |
| # some old version was left around. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| BAK_PATH="${HOME}/.config/quassel-irc.org/quassel-storage.sqlite.bak" | |
| CURRENT_PATH="${HOME}/.config/quassel-irc.org/quassel-storage.sqlite" | |
| # first day of data that will be maintained | |
| # -15 day means that *every* chatline stored before 16 days ago and so on are going to be eliminated. | |
| # only the last 15 days are keeped. | |
| DATE_TO_PRUNE='-15 day' | |
| die() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Compare GRVT CCXT-compatibility API with a known similiar decentralised perp exchange. | |
| - Run the same CCXT API functions against know decentralised perp exchange and GRVT | |
| and compare the results | |
| """ | |
| import logging | |
| import os | |
| from pprint import pprint | |
| import ccxt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Apache configuration for running local browser against a locally running xxxx for manual smartcard testing | |
| # Listen 4433 | |
| <VirtualHost 127.0.0.1:4433> | |
| # Real men use mod_proxy | |
| DocumentRoot "/nowhere" | |
| ServerName local-apache | |
| ServerAdmin you@example.com |
NewerOlder