A Python framework for interacting with Solana's Pyth network.

Related tags

Networkingpythpy
Overview

Pyth Network

A basic Python framework for reading and decoding data regarding the Pyth network oracles.

Install

pip3 install pythpy

Setup

import pythpy
from solana.rpc.api import Client

# use a Solana client to get Pyth oracle data
solana_client = Client(
    endpoint='https://api.mainnet-beta.solana.com',
    commitment='confirmed'
)
# public address for the Pyth SOL oracle
sol_oracle_address = 'H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG'
oracle_account_info = pythpy.call_oracle_account(
    client=solana_client, 
    address=sol_oracle_address
)
# view the info
print(oracle_account_info)

Output:

{
    "magic": 2712847316,
    "version": 2,
    "oracle_type": 3,
    "size": 1872,
    "price_type": 1,
    "exponent": -8,
    "num_component_prices": 17,
    "num_quoters": 15,
    "last_slot": 109163611,
    "valid_slot": 109163610,
    "twap": {
        "value": 188.081046,
        "fraction": {
            "numerator": 4446404127,
            "denominator": 2364089437
        }
    },
    "twac": {
        "value": 0.10387786,
        "fraction": {
            "numerator": 2455765564,
            "denominator": 2364089437
        }
    },
    "drv1": 1e-08,
    "drv2": 3e-08,
    "product_account_key": "ALP8SdU9oARYVLgLR7LrqMNCYBnhtnQz1cj6bwgwQmgj",
    "next_price_account_key": "11111111111111111111111111111111",
    "previous_slot": 109163609,
    "previous_price": 189.912598,
    "previous_confidence": 0.142106,
    "drv3": 0.0,
    "aggregate": {
        "price": 189.914705,
        "confidence": 0.15314,
        "status": 1,
        "corporate_action": 0,
        "publish_slot": 109163611
    },
    "price_components": [
        {
            "price": 189.922,
            "confidence": 0.074,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163603
        },
        {
            "price": 189.9655,
            "confidence": 0.0695,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163605
        },
        {
            "price": 189.9125,
            "confidence": 0.03348694,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163603
        },
        {
            "price": 189.9125,
            "confidence": 0.03348694,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163603
        },
        {
            "price": 189.801,
            "confidence": 0.0075,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163604
        },
        {
            "price": 189.801,
            "confidence": 0.0075,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163604
        },
        {
            "price": 189.90375,
            "confidence": 0.0875,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163604
        },
        {
            "price": 189.90375,
            "confidence": 0.0875,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163604
        },
        {
            "price": 189.8,
            "confidence": 0.22,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163604
        },
        {
            "price": 189.8,
            "confidence": 0.22,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163604
        },
        {
            "price": 189.94324999,
            "confidence": 0.0945,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163603
        },
        {
            "price": 189.94975,
            "confidence": 0.0945,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163604
        },
        {
            "price": 189.9695,
            "confidence": 0.0915,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163592
        },
        {
            "price": 189.8795,
            "confidence": 0.0915,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163604
        },
        {
            "price": 189.945,
            "confidence": 0.224,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163605
        },
        {
            "price": 189.945,
            "confidence": 0.224,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163605
        },
        {
            "price": 190.00769337,
            "confidence": 0.09500384,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163605
        },
        {
            "price": 190.00769337,
            "confidence": 0.09500384,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163605
        },
        {
            "price": 189.9665,
            "confidence": 0.08199159,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163603
        },
        {
            "price": 189.9665,
            "confidence": 0.08199159,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163603
        },
        {
            "price": 189.9175,
            "confidence": 0.0328868,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163603
        },
        {
            "price": 189.9175,
            "confidence": 0.0328868,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163603
        },
        {
            "price": 189.94345807,
            "confidence": 0.09032811,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163605
        },
        {
            "price": 189.94345807,
            "confidence": 0.09032811,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163605
        },
        {
            "price": 189.94001131,
            "confidence": 0.12145504,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163605
        },
        {
            "price": 189.94001131,
            "confidence": 0.12145504,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163605
        },
        {
            "price": 189.90292767,
            "confidence": 0.08596382,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163603
        },
        {
            "price": 189.90292767,
            "confidence": 0.08596382,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163603
        },
        {
            "price": 189.95925,
            "confidence": 0.32675,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163605
        },
        {
            "price": 189.95925,
            "confidence": 0.32675,
            "status": 1,
            "corporate_action": 0,
            "publish_slot": 109163605
        }
    ]
}
Extended refactoring capabilities for Python LSP Server using Rope.

pylsp-rope Extended refactoring capabilities for Python LSP Server using Rope. This is a plugin for Python LSP Server, so you also need to have it ins

36 Dec 24, 2022
Wallc - Calculate the layout on the wall to hang up pictures

wallc Calculate the layout on the wall to hang up pictures. Installation pip install git+https://github.com/trbznk/wallc.git Getting Started Currently

Alex Trbznk 68 Sep 09, 2022
基于多线程快速端口扫描脚本,支持目标批量导入、结果导出。

JWS_portscan 基于多线程快速端口扫描脚本,支持目标批量导入、结果导出。如果扫描公网资产,为了提升扫描的精准性,建议放到服务器运行。 用法 依赖安装:pip3 install -r requriement.txt 支持参数:python3 JWS_portscan.py --help 脚本

jammny 5 Apr 12, 2022
Eclipse zenoh Python API

Eclipse zenoh Python API Eclipse zenoh is an extremely efficient and fault-tolerant Named Data Networking (NDN) protocol that is able to scale down to

26 Jan 05, 2023
Using AWS's API Gateway + Lambda + Python to run a simple websocket application. For learning/testing

Using AWS's API Gateway + Lambda + Python to run a simple websocket application. For learning/testing. The AWS Resources seemed overly complex and were missing some critical gotchas in setting up a s

Seth Miller 15 Dec 23, 2022
This script aims to make the dynamic public ip of your local server, public.

EZ DDNS CLOUDFLARE This script aims to make the dynamic ip of your local server, public. It does this by regularly updating cloudflare's dns record. B

3 Feb 13, 2022
A library of functions that can be used to manage the download of claims from the LBRY network.

lbrytools A library of functions that can be used to manage the download of claims from the LBRY network. It includes methods to download claims by UR

13 Dec 03, 2022
A simple python script to send cute messages to my boyfriend.

Morning Messages A simple python script to send cute messages to my boyfriend. It gives him the weather and news currently. Installation git clone htt

Sabrina Medwinter 3 Oct 12, 2022
Network Dynaimcs Simulation

A Final Year Project in CUHK, Autumn 2021 Network Dynaimcs Simulation Files param.h edit all the variables & settings here simulate.c the main program

Likchun 0 Mar 28, 2022
a decompilation of NAP36 the widevine removal software for amz and nf used by p2p groups until it stoped working due to it using expired cdm keys

NAP36 a decompilation of NAP36 the widevine removal software for amz and nf used by p2p groups until it stoped working due to it useing expired cdm ke

9 Aug 29, 2021
ProtOSINT is a Python script that helps you investigate Protonmail accounts and ProtonVPN IP addresses

ProtOSINT ProtOSINT is a Python script that helps you investigate ProtonMail accounts and ProtonVPN IP addresses. Description This tool can help you i

pixelbubble 249 Dec 23, 2022
A Python library to utilize AWS API Gateway's large IP pool as a proxy to generate pseudo-infinite IPs for web scraping and brute forcing.

A Python library to utilize AWS API Gateway's large IP pool as a proxy to generate pseudo-infinite IPs for web scraping and brute forcing.

George O 929 Jan 01, 2023
This is a simple python script to collect sub-domains from hackertarget API

Domain-Scraper 🌐 This is a simple python script to collect sub-domains from hackertarget API Note : This is tool is limited to 20 Queries / day with

CHINO TECH TOOLS 4 Sep 09, 2021
Flashes keyboard leds on incoming/outgoing network packets

LED Net Capture Flashes keyboard leds on incoming/outgoing network packets Usage Requires root priviledges to run usage: ledcapture.py [-h] --keyboard

Dan Habot 56 Oct 27, 2022
Script and library to wait for a DNS authority server to get its configuration.

DNSWait dnswait is a small script to wait for the "propagation" of a namserver configuration. Installing It's as easy as: python -m pip install dnswai

Julien Palard 14 Jan 17, 2022
Interact remotely with the computer using Python and MQTT protocol 💻

Comandos_Remotos Interagir remotamento com o computador através do Python e protocolo MQTT. 💻 Status: em desenvolvimento 🚦 Objetivo: Interagir com o

Guilherme_Donizetti 6 May 10, 2022
test whether http(s) proxies actually hide your ip

Proxy anonymity I made this for other projects, to find working proxies. If it gets enough support and if i have time i might make it into a gui Repos

gxzs1337 1 Nov 09, 2021
Easy to use gRPC-web client in python

pyease-grpc Easy to use gRPC-web client in python Tutorial This package provides a requests like interface to make calls to gRPC-Web servers.

Sudipto Chandra 4 Dec 03, 2022
The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)

gRPC - An RPC library and framework gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC

grpc 36.6k Dec 30, 2022
Bark Toolkit is a toolkit wich provides Denial-of-service attacks, SMS attacks and more.

Bark Toolkit About Bark Toolkit Bark Toolkit is a set of tools that provides denial of service attacks. Bark Toolkit includes SMS attack tool, HTTP

13 Jan 04, 2023