virtualOffer: true, the orderbook converts between PT and YT using strip and merge operations — no extra steps on your end.
Available Routes
All four routes share the same underlying liquidity:| Route | offerType | virtualOffer | Description |
|---|---|---|---|
| SY → YT | OfferType.BuyYt | false | Exchange SY for YT |
| YT → SY | OfferType.SellYt | false | Exchange YT for SY |
| SY → PT | OfferType.SellYt | true | Exchange SY for PT |
| PT → SY | OfferType.BuyYt | true | Exchange PT for SY |
How It Works
Strip (SY → PT + YT)
When you buy PT (virtualSellYt), the orderbook:
- Takes SY from you
- Strips SY into PT + YT
- Gives PT to you
- Uses the YT to fill against existing YT sell orders
Merge (PT + YT → SY)
When you sell PT (virtualBuyYt), the orderbook:
- Takes PT from you
- Obtains YT from matched buy orders
- Merges PT + YT into SY
- Gives SY to you
Direct YT Trading
Non-virtual orders trade YT directly against counter-orders — no strip or merge required.Using Virtual Offers in the SDK
PassvirtualOffer: true when posting or executing PT orders: