Swapping NFTs and Tokens
swap_tokens_for_nfts_with_slippage<CURRENCY>(...)
and
swap_nfts_for_tokens_with_slippage<CURRENCY>(...)
Purpose: Execute trades between NFTs and tokens within the pool, similar to token swaps on an AMM.
Process:
Verify the pool is active and ensure the trader is not on any deny list (via ART20 checks).
Calculate output amounts and verify slippage limits are respected.
Adjust pool reserves and transfer assets.
Emit a
TradeExecuted
event.
Use Cases:
Traders can instantly buy or sell NFTs without waiting for a buyer or seller, relying on the pool’s liquidity.
Automated trading strategies or arbitrageurs can operate on these pools.
Best Practices:
Use strict slippage tolerances to avoid adverse price impacts.
Monitor TWAP and other price signals before executing large trades.
Last updated