HyperSwitch Plugins let you build once, use anywhere across backtests, paper trading, and live markets.
They are:
🔌 Modular & reusable components
📦 Environment-agnostic (backtest, sandbox, live)
🧩 Easy to plug into any strategy or workflow
🌐 Exchange-agnostic with unified interfaces
Create, share, or combine plugins for indicators, strategies, risk controls, and more — all while keeping your code clean and scalable.
What Can I Do with Hyperswitch?
Hyperswitch offers a modular, open-source payments infrastructure designed for flexibility and control. Apart from our Payment Suite offering, this solution allows businesses to pick and integrate only the modules they need on top of their existing payment stack — without unnecessary complexity or vendor lock-in.
Each module is independent and purpose-built to optimize different aspects of payment processing.
Learn More About The Payment Modules
Cost Observability Advanced observability tools to audit, monitor, and optimize your payment costs. Detect hidden fees, downgrades, and penalties with self-serve dashboards and actionable insights. Read more
Revenue Recovery Combat passive churn with intelligent retry strategies tuned by card bin, region, method, and more. Offers fine-grained control over retry algorithms, penalty budgets, and recovery transparency. Read more
Vault A PCI-compliant vault service to store cards, tokens, wallets, and bank credentials. Provides a unified, secure, and reusable store of customer-linked payment methods. Read more
Intelligent Routing Route each transaction to the PSP with the highest predicted auth rate. Reduce retries, avoid downtime, and minimize latency while maximizing first attempt success. Read more
Reconciliation Automate 2-way and 3-way reconciliation with backdated support, staggered scheduling, and customizable outputs. Reduces manual ops effort and increases audit confidence. Read more
Alternate Payment Methods Drop-in widgets for PayPal, Apple Pay, Google Pay, Samsung Pay, Pay by Bank, and BNPL providers like Klarna. Maximizes conversions with seamless one-click checkout. Read more
### Trade Stocks, Crypto, Futures, and Forex
from HyperSwitch import Alpaca, CoinbasePro
stocks = Alpaca()
crypto = CoinbasePro()
futures = BinanceFutures()
# Easily perform the same actions across exchanges & asset types
stocks.interface.market_order('AAPL', 'buy', 1)
crypto.interface.market_order('BTC-USD', 'buy', 1)
# Full futures feature set
futures.interface.get_hedge_mode()
Backtest your trades, events, websockets, and custom data
import HyperSwitch
"""
This example shows how backtest over tweets
"""
class TwitterBot(HyperSwitch.Model):
def main(self, args):
while self.has_data:
self.backtester.value_account()
self.sleep('1h')
def event(self, type_: str, data: str):
# Now check if it's a tweet about Tesla
if 'tsla' in data.lower() or 'gme' in data.lower():
# Buy, sell or evaluate your portfolio
pass
if __name__ == "__main__":
exchange = HyperSwitch.Alpaca()
model = TwitterBot(exchange)
# Add the tweets json here
model.backtester.add_custom_events(HyperSwitch.data.JsonEventReader('./tweets.json'))
# Now add some underlying prices at 1 month
model.backtester.add_prices('TSLA', '1h', start_date='3/20/22', stop_date='4/15/22')
# Backtest or run live
print(model.backtest(args=None, initial_values={'USD': 10000}))
🛠️ Installation
Follow the steps below to install and run this project on your local machine.
1. 📦 Prerequisites
Make sure you have the following tools installed on your system:
Why HyperSwitch Plugins?
HyperSwitch Plugins let you build once, use anywhere across backtests, paper trading, and live markets.
They are:
Create, share, or combine plugins for indicators, strategies, risk controls, and more — all while keeping your code clean and scalable.
What Can I Do with Hyperswitch?
Hyperswitch offers a modular, open-source payments infrastructure designed for flexibility and control. Apart from our Payment Suite offering, this solution allows businesses to pick and integrate only the modules they need on top of their existing payment stack — without unnecessary complexity or vendor lock-in.
Each module is independent and purpose-built to optimize different aspects of payment processing.
Learn More About The Payment Modules
Cost Observability
Advanced observability tools to audit, monitor, and optimize your payment costs. Detect hidden fees, downgrades, and penalties with self-serve dashboards and actionable insights.
Read more
Revenue Recovery
Combat passive churn with intelligent retry strategies tuned by card bin, region, method, and more. Offers fine-grained control over retry algorithms, penalty budgets, and recovery transparency.
Read more
Vault
A PCI-compliant vault service to store cards, tokens, wallets, and bank credentials. Provides a unified, secure, and reusable store of customer-linked payment methods.
Read more
Intelligent Routing
Route each transaction to the PSP with the highest predicted auth rate. Reduce retries, avoid downtime, and minimize latency while maximizing first attempt success.
Read more
Reconciliation
Automate 2-way and 3-way reconciliation with backdated support, staggered scheduling, and customizable outputs. Reduces manual ops effort and increases audit confidence.
Read more
Alternate Payment Methods
Drop-in widgets for PayPal, Apple Pay, Google Pay, Samsung Pay, Pay by Bank, and BNPL providers like Klarna. Maximizes conversions with seamless one-click checkout.
Read more
Backtest your trades, events, websockets, and custom data
🛠️ Installation
Follow the steps below to install and run this project on your local machine.
1. 📦 Prerequisites
Make sure you have the following tools installed on your system:
3. 📦 Install Dependencies
Install the required npm packages:
If the plugin uses Python-based tools or indicators, install the Python dependencies as well:
4. 🔐 Set Up Exchange API Keys
To allow the plugin to interact with cryptocurrency exchanges, set up your API credentials.
Create a
.envfile in the root directory and add your exchange keys:5. ⚙️ Configure the Plugin
Each plugin comes with a configuration file. For example:
You can modify these values based on your trading preferences.
6. ▶️ Run the Plugin
Once everything is set up, start the plugin:
Or, if you’re using a custom script:
7. 🐳 Optional: Run with Docker
Build and run the plugin using Docker:
erDiagram PLUGIN { string id string name string type } PLUGIN ||--o{ STRATEGY : implements STRATEGY ||--o{ INDICATOR : uses STRATEGY ||--o{ EXECUTOR : runs EXECUTOR ||--o{ MARKET_INTERFACE : interacts MARKET_INTERFACE }|--o{ EXCHANGE : connects PLUGIN ||--o{ CONFIGURATION : requires PLUGIN ||--o{ LOGGING : logsContributors
wouldn’t be without you. If we are going to disrupt financial industry, every contribution counts. Thank you for being part of this journey.