Skip to content

Commit df93cab

Browse files
SwenschaeferjohannSwenschaeferjohann
authored andcommitted
add compressTokenOutIx to readme.md
1 parent 3ab758e commit df93cab

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

readme.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
## Jup Swap with Compressed Tokens - Demo
22

3-
- Creates a single swap transaction with [additional instructions](https://github.com/Lightprotocol/example-jupiter-swap-node/blob/main/src/buildCompressedSwapTx.ts#L192-L200): `createInAtaIx`, `decompressIx`, `closeInAtaIx`
4-
- Accepts compressed tokens as tokenIn.
5-
- Cleans up ATA for tokenIn after swap.
6-
- Clean up ATA for tokenOut via `compressOutAtaIx` support is in progress.
3+
- Creates a single swap transaction with [additional instructions](https://github.com/Lightprotocol/example-jupiter-swap-node/blob/main/src/buildCompressedSwapTx.ts#L192-L200): `createTokenInAtaIx`, `createTokenOutAtaIx`, `decompressTokenInIx`, `compressTokenOutIx`, `closeTokenInAtaIx`, `closeTokenOutAtaIx`
4+
- Accepts compressed tokens as tokenIn
5+
- Returns compressed tokens as tokenOut
6+
- Cleans up intermediate ATAs for tokenIn after the swap
7+
- Cleans up ATA for tokenOut after the swap.
8+
9+
to use the `compressTokenOutIx` feature, checkout [this branch](https://github.com/Lightprotocol/example-jupiter-swap-node/tree/use-compress-out-ata).
710

811
### Notes
12+
913
- This e2e integration does not require on-chain changes to the Jup program.
1014
- Demo requires `directSwapsOnly=true` to avoid occasional tx size overruns (+ ~300 bytes overhead). This can be fixed by integrating natively in Jup's API for `setupInstructions` and `cleanupInstructions`.
15+
- Future/Optional: `useSharedAccounts` could remove the need for intermediate ATA setup and cleanup.
1116

1217
### Setup
1318

@@ -23,18 +28,27 @@ yarn
2328

2429
```
2530
# get quotes, see tx size
26-
ROUNDS=5 yarn dryrun # runs 5 rounds
27-
yarn dryrun # runs 1 round (default)
31+
yarn quote # runs 1 round (default)
32+
ROUNDS=5 yarn quote # runs 5 rounds
33+
COMPRESS_TOKEN_OUT=true yarn quote # uses compressTokenOutIx feature (default: false)
2834
```
2935

3036
```
3137
# also send and confirm
32-
ROUNDS=5 yarn send # runs 5 rounds
33-
yarn send # runs 1 round (default)
38+
yarn swap # runs 1 round (default)
39+
ROUNDS=5 yarn swap # runs 5 rounds
40+
COMPRESS_TOKEN_OUT=true yarn swap # uses compressTokenOutIx feature (default: false)
3441
```
3542

3643
### Example tx sigs:
3744

45+
with compressTokenOutIx:
46+
47+
- https://solscan.io/tx/47duf8bTsK7Fi6dQgeHbD3GwPXC1GFiiBnLEq1i6jSRtKcwc2by7Rxbx7dxkKeA6EyVuJf1b5BhL6EKgsSAzFKXG
48+
- https://solscan.io/tx/2qdBGCKhGnhSQKfoyiY3eHoChuHkQ7QtZpCR9m2CWTvLxwivxcRTNpUqtQkxPrWHd2ibh5QWwjsTjGnq7VsmAwzd
49+
50+
without compressTokenOutIx:
51+
3852
- https://solscan.io/tx/4QiVMPKYQxZTQZagT6LDaooaUecSzFNTWkHM3UsQ7om2WvzqLWip3GQ5Gj8a4pYBuLD124RVnP2QKvp6EPRBidTK
3953
- https://solscan.io/tx/5JPv1k9HRqdzie8DcpYFFbwcLmdxYFu9rLpyrFFYii4AE6XPfrk59tgpRasZfykvLn6QgLhzBCKxFvBaNWTYRp4K
4054
- https://solscan.io/tx/3KVwEPz1XFxNifz7hptqQWSeM3vgxBDCj2v1SwLMjgRS9iKLi8mEoHzyuvcsAzMjPwLp9c3mizUy5hKYSKXELwuV

0 commit comments

Comments
 (0)