diff --git a/readme.md b/readme.md index b9d7e2d..1daae80 100644 --- a/readme.md +++ b/readme.md @@ -1,13 +1,18 @@ ## Jup Swap with Compressed Tokens - Demo -- 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` -- Accepts compressed tokens as tokenIn. -- Cleans up ATA for tokenIn after swap. -- Clean up ATA for tokenOut via `compressOutAtaIx` support is in progress. +- 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` +- Accepts compressed tokens as tokenIn +- Returns compressed tokens as tokenOut +- Cleans up intermediate ATAs for tokenIn after the swap +- Cleans up ATA for tokenOut after the swap. + +to use the `compressTokenOutIx` feature, checkout [this branch](https://github.com/Lightprotocol/example-jupiter-swap-node/tree/use-compress-out-ata). ### Notes + - This e2e integration does not require on-chain changes to the Jup program. - 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`. +- Future/Optional: `useSharedAccounts` could remove the need for intermediate ATA setup and cleanup. ### Setup @@ -23,18 +28,27 @@ yarn ``` # get quotes, see tx size -ROUNDS=5 yarn dryrun # runs 5 rounds -yarn dryrun # runs 1 round (default) +yarn quote # runs 1 round (default) +ROUNDS=5 yarn quote # runs 5 rounds +COMPRESS_TOKEN_OUT=true yarn quote # uses compressTokenOutIx feature (default: false) ``` ``` # also send and confirm -ROUNDS=5 yarn send # runs 5 rounds -yarn send # runs 1 round (default) +yarn swap # runs 1 round (default) +ROUNDS=5 yarn swap # runs 5 rounds +COMPRESS_TOKEN_OUT=true yarn swap # uses compressTokenOutIx feature (default: false) ``` ### Example tx sigs: +with compressTokenOutIx: + +- https://solscan.io/tx/47duf8bTsK7Fi6dQgeHbD3GwPXC1GFiiBnLEq1i6jSRtKcwc2by7Rxbx7dxkKeA6EyVuJf1b5BhL6EKgsSAzFKXG +- https://solscan.io/tx/2qdBGCKhGnhSQKfoyiY3eHoChuHkQ7QtZpCR9m2CWTvLxwivxcRTNpUqtQkxPrWHd2ibh5QWwjsTjGnq7VsmAwzd + +without compressTokenOutIx: + - https://solscan.io/tx/4QiVMPKYQxZTQZagT6LDaooaUecSzFNTWkHM3UsQ7om2WvzqLWip3GQ5Gj8a4pYBuLD124RVnP2QKvp6EPRBidTK - https://solscan.io/tx/5JPv1k9HRqdzie8DcpYFFbwcLmdxYFu9rLpyrFFYii4AE6XPfrk59tgpRasZfykvLn6QgLhzBCKxFvBaNWTYRp4K - https://solscan.io/tx/3KVwEPz1XFxNifz7hptqQWSeM3vgxBDCj2v1SwLMjgRS9iKLi8mEoHzyuvcsAzMjPwLp9c3mizUy5hKYSKXELwuV