SwitchlyNode is the core blockchain protocol powering SwitchlyProtocol, a decentralized cross-chain automated market maker (AMM) built on the Cosmos SDK.
SwitchlyProtocol enables:
- Cross-chain swaps: Native asset swaps across different blockchains without wrapped tokens
- Liquidity provision: Earn yield by providing liquidity to cross-chain pools
- Savers vaults: Single-sided liquidity provision with native yield
- Lending protocol: Collateralized lending using cross-chain assets
- Trade accounts: Margin trading with cross-chain collateral
SwitchlyNode consists of several key components:
- SwitchlyNode: Cosmos SDK-based blockchain handling consensus, validation, and cross-chain logic
- Bifrost: Multi-chain bridge client connecting SwitchlyProtocol to external blockchains
- TSS (Threshold Signature Scheme): Distributed key management for secure cross-chain transactions
SwitchlyProtocol supports native assets from:
- Bitcoin (BTC)
- Ethereum (ETH) and ERC-20 tokens
- Binance Smart Chain (BSC) and BEP-20 tokens
- Avalanche (AVAX) and ARC-20 tokens
- Cosmos (ATOM)
- Dogecoin (DOGE)
- Bitcoin Cash (BCH)
- Litecoin (LTC)
- And more...
Ensure you have a recent version of go (scripts/check-env.sh) and enabled go modules.
Also, make sure you have jq installed.
git clone https://gitlab.com/switchly/switchlynode.git
cd switchlynode
make installThis will install switchlynode binary into your $GOPATH/bin.
For a quick start with a local development environment:
make reset-mocknet-standaloneThis will:
- Build the
switchlynodebinary - Initialize a single-node testnet
- Start the node with pre-configured accounts and balances
The node can be configured through:
- Environment variables
- Command line flags
- Configuration files in
~/.switchlynode/config/
Key configuration files:
app.toml: Application-specific settingsconfig.toml: Tendermint consensus settingsgenesis.json: Genesis state and parameters
To start the node:
switchlynode startFor development with automatic restarts:
make run-mocknet-standaloneRun the full test suite:
make testRun specific tests:
go test ./x/switchlyprotocol/...make lintmake docker-buildGet node information:
curl -s localhost:1317/switchlyprotocol/nodes | jqGet pool information:
curl -s localhost:1317/switchlyprotocol/pools | jqGet network status:
curl -s localhost:1317/switchlyprotocol/network | jqSet mimir values (admin only):
switchlynode tx switchlyprotocol mimir CHURNINTERVAL 1000 --from admin $TX_FLAGSSwitchlyProtocol follows a structured development process:
- Create an issue or find an existing issue on https://gitlab.com/switchly/switchlynode/-/issues
- Fork the repository and create a feature branch
- Make your changes following the coding standards
- Add tests for new functionality
- Submit a merge request with a clear description
SwitchlyProtocol follows an Architectural Decision Record process outlined here: https://gitlab.com/switchly/switchlynode/-/blob/develop/docs/architecture/PROCESS.md?ref_type=heads
Releases are automated through GitLab CI/CD. When a merge request is merged to the develop branch,
if the merge request upgrades the version, then a new release will be created automatically, and the repository will be tagged with
the new version.
The process to integrate a new chain into SwitchlyProtocol is multifaceted, requiring changes to multiple repositories across different languages (golang, python, and javascript).