Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 5b1b87e

Browse files
authored
token-swap: Prepare v3.0.0 release for testnet and devnet (#3227)
1 parent 677acf1 commit 5b1b87e

File tree

9 files changed

+36
-21
lines changed

9 files changed

+36
-21
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/token-swap.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,23 @@ title: Token Swap Program
55
A Uniswap-like exchange for the Token program on the Solana blockchain,
66
implementing multiple automated market maker (AMM) curves.
77

8-
Here is some important developer information regarding the program deployed on devnet,
9-
testnet, and mainnet-beta:
8+
## Available Deployments
109

11-
| Information | Account Address |
12-
| --- | --- |
13-
| Token Swap Program | `SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8` |
14-
| Fee Owner | `HfoTxFR1Tm6kGmWgYWD6J7YHVy1UwqSULUGVLXkJqaKN` |
10+
11+
| Network | Version | Program Address | Fee Owner Address |
12+
| --- | --- | --- |
13+
| Devnet, Testnet | 3.0.0 | `SwapsVeCiPHMUAtzQWZw7RjsKjgCjhwU55QGu4U1Szw` | Any |
14+
| All | 2.0.0 | `SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8` | `HfoTxFR1Tm6kGmWgYWD6J7YHVy1UwqSULUGVLXkJqaKN` |
15+
16+
The Token Swap Program was deployed to all networks by the Serum team at
17+
`SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8`, requiring a fee owner of
18+
`HfoTxFR1Tm6kGmWgYWD6J7YHVy1UwqSULUGVLXkJqaKN`, but that version was deprecated
19+
in the middle of 2021. Though that program still exists, it is not actively
20+
maintained.
21+
22+
For devnet and testnet, please use the maintainted deployment at
23+
`SwapsVeCiPHMUAtzQWZw7RjsKjgCjhwU55QGu4U1Szw`, and for mainnet, please use any
24+
other AMM project on Solana. Almost all of these were based on Token Swap!
1525

1626
Check out
1727
[program repository](https://github.com/solana-labs/solana-program-library/tree/master/token-swap)

token-swap/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Token Swap Program
22

3-
A Uniswap-like exchange for the Token program on the Solana blockchain, deployed
4-
to `SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8` on all networks.
3+
A Uniswap-like exchange for the Token program on the Solana blockchain.
54

65
Full documentation is available at https://spl.solana.com/token-swap
76

87
JavaScript bindings are available in the `./js` directory.
98

10-
## Building
9+
## Building master
1110

1211
To build a development version of the Token Swap program, you can use the normal
1312
build command for Solana programs:
@@ -16,10 +15,12 @@ build command for Solana programs:
1615
cargo build-bpf
1716
```
1817

19-
For production versions, the Token Swap Program contains a `production` feature
20-
to fix constraints on fees and fee account owner. A developer can
21-
deploy the program, allow others to create pools, and earn a "protocol fee" on
22-
all activity.
18+
## Building mainnet v2.0.0
19+
20+
For the version deployed to `SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8`,
21+
the Token Swap Program contains a `production` feature to fix constraints on fees
22+
and fee account owner. A developer can deploy the program, allow others to create
23+
pools, and earn a "protocol fee" on all activity.
2324

2425
Since Solana programs cannot contain any modifiable state, we must hard-code
2526
all constraints into the program. `SwapConstraints` in `program/src/constraints.rs`

token-swap/js/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

token-swap/js/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solana/spl-token-swap",
3-
"version": "0.1.4",
3+
"version": "0.2.0",
44
"description": "SPL Token Swap JavaScript API",
55
"license": "MIT",
66
"author": "Solana Maintainers <[email protected]>",
@@ -32,7 +32,7 @@
3232
"build": "tsc -p tsconfig.json && tsc-esm -p tsconfig.json && tsc -p tsconfig.cjs.json",
3333
"postbuild": "echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json && echo '{\"type\":\"module\"}' > dist/esm/package.json",
3434
"test": "ts-node test/main.ts",
35-
"start-with-test-validator": "start-server-and-test 'solana-test-validator --bpf-program SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8 ../../target/deploy/spl_token_swap.so --reset --quiet' http://localhost:8899/health test",
35+
"start-with-test-validator": "start-server-and-test 'solana-test-validator --bpf-program SwapsVeCiPHMUAtzQWZw7RjsKjgCjhwU55QGu4U1Szw ../../target/deploy/spl_token_swap.so --reset --quiet' http://localhost:8899/health test",
3636
"lint": "npm run pretty && eslint .",
3737
"lint:fix": "npm run pretty:fix && eslint . --fix",
3838
"build:program": "cargo build-bpf --manifest-path ../program/Cargo.toml",

token-swap/js/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ import * as Layout from './layout';
2020
import {loadAccount} from './util/account';
2121

2222
export const TOKEN_SWAP_PROGRAM_ID: PublicKey = new PublicKey(
23+
'SwapsVeCiPHMUAtzQWZw7RjsKjgCjhwU55QGu4U1Szw',
24+
);
25+
26+
export const OLD_TOKEN_SWAP_PROGRAM_ID: PublicKey = new PublicKey(
2327
'SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8',
2428
);
2529

token-swap/program/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "spl-token-swap"
3-
version = "2.1.0"
3+
version = "3.0.0"
44
description = "Solana Program Library Token Swap"
55
authors = ["Solana Maintainers <[email protected]>"]
66
repository = "https://github.com/solana-labs/solana-program-library"

token-swap/program/program-id.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8
1+
SwapsVeCiPHMUAtzQWZw7RjsKjgCjhwU55QGu4U1Szw

token-swap/program/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ mod entrypoint;
1515
// Export current sdk types for downstream users building with a different sdk version
1616
pub use solana_program;
1717

18-
solana_program::declare_id!("SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8");
18+
solana_program::declare_id!("SwapsVeCiPHMUAtzQWZw7RjsKjgCjhwU55QGu4U1Szw");

0 commit comments

Comments
 (0)