Skip to content

pulseprotocolorg-cyber/pulse-binance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PULSE-Binance

PyPI version PyPI downloads License

Binance adapter for PULSE Protocol — trade Binance with semantic messages.

Write your trading bot once, run it on any exchange. Same code works with Bybit, Kraken, OKX — just change one line.

Quick Start

pip install pulse-binance
from pulse import PulseMessage
from pulse_binance import BinanceAdapter

# Connect
adapter = BinanceAdapter(api_key="your-key", api_secret="your-secret")
adapter.connect()

# Get BTC price
msg = PulseMessage(action="ACT.QUERY.DATA", parameters={"symbol": "BTCUSDT"})
response = adapter.send(msg)
print(response.content["parameters"]["result"]["price"])

Switch Exchanges in One Line

# from pulse_binance import BinanceAdapter as Adapter
from pulse_bybit import BybitAdapter as Adapter

adapter = Adapter(api_key="...", api_secret="...")

Your bot code stays exactly the same. Only the import changes.

Supported Actions

PULSE Action What It Does Binance Endpoint
ACT.QUERY.DATA Price, 24h stats, klines, order book /api/v3/ticker/price, /klines, /depth
ACT.TRANSACT.REQUEST Place market/limit order /api/v3/order
ACT.CANCEL Cancel an order /api/v3/order (DELETE)
ACT.QUERY.STATUS Check order status /api/v3/order (GET)
ACT.QUERY.LIST List open orders /api/v3/openOrders
ACT.QUERY.BALANCE Account balances /api/v3/account

Examples

Query price

msg = PulseMessage(
    action="ACT.QUERY.DATA",
    parameters={"symbol": "BTCUSDT", "type": "price"}
)
response = adapter.send(msg)

Place a limit order

msg = PulseMessage(
    action="ACT.TRANSACT.REQUEST",
    parameters={
        "symbol": "ETHUSDT",
        "side": "BUY",
        "quantity": 0.1,
        "order_type": "LIMIT",
        "price": 3000,
        "time_in_force": "GTC",
    }
)
response = adapter.send(msg)

Get order book

msg = PulseMessage(
    action="ACT.QUERY.DATA",
    parameters={"symbol": "BTCUSDT", "type": "depth", "limit": 10}
)
response = adapter.send(msg)

Features

  • HMAC-SHA256 authentication — Binance signing fully handled
  • Testnet support — test with BinanceAdapter(testnet=True)
  • Standard pair format — use BTCUSDT, ETHUSDT, etc.
  • Tiny footprint — one file, ~10 KB

Testing

pytest tests/ -q  # All tests mocked, no API key needed

PULSE Ecosystem

Package Provider Install
pulse-protocol Core pip install pulse-protocol
pulse-binance Binance pip install pulse-binance
pulse-bybit Bybit pip install pulse-bybit
pulse-kraken Kraken pip install pulse-kraken
pulse-okx OKX pip install pulse-okx
pulse-openai OpenAI pip install pulse-openai
pulse-anthropic Anthropic pip install pulse-anthropic
pulse-gateway Gateway pip install pulse-gateway

License

Apache 2.0 — open source, free forever.

About

Binance adapter for PULSE Protocol — pip install pulse-binance

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages