// Set the amount to trade
double amount = 100.0;
// Register a trade event between two Agent NPCs
TradeEvent tradeEvent = PixocracySDK.AgentNPCManager().registerTradeEvent(
instance,
trader, // The Agent NPC giving the wealth
recipient, // The Agent NPC receiving the wealth
amount // The amount of wealth to transfer
);
// The wealth has been transferred from the trader to the recipient
double traderNewWealth = trader.getWealth();
double recipientNewWealth = recipient.getWealth();