> For the complete documentation index, see [llms.txt](https://docs.hollaex.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hollaex.com/advanced/the-network-tool-library/getting-more-interesting-orders-with-the-tools/settling-fees.md).

# Settling Fees

So after a few trades have gone back and forth, you may have noticed that part of the object returned from the getUserTrades command was fees. In our example, these were teeny tiny little slivers of USDT, but as my old teacher said "Look after the pennies and the pounds will look after themselves" (replace with pounds and pennies with your regional currency).

So as trades get fulfilled on your exchange these fees will mount up and up, ready to be released (settled) to the admin account. Luckily, this could not be simpler.

{% hint style="info" %}
`settleFees` requires a 48-hour period 'cooldown' between uses
{% endhint %}

### Settling Fees Script

```javascript
const Network = require('./index');

const network = new Network({
    apiUrl: 'https://api.hollaex.network',
    apiKey: '<YOUR_API_KEY>',
    apiSecret: '<YOUR_API__SECRET_KEY>',
    activation_code: '<YOUR_ACTIVATION_CODE>',
});

//settling fees and seeing them
(async () => {
	try {
		//initialise the network
		const init = await network.init();
		
		//settle the accumulated fees since last settling
		await network.settleFees()
		
		//get a report on historical fee date 
		//we could add optional parameters to refine results
        	console.log(await network.getGeneratedFees())
        
	} catch (err) {
		console.log(err);
	}
})();

```

### Transfer Assets Script: Output

```javascript
       //generated fees for USDT
    [ { id: 70,
       transaction_id: '60014cde-aff0-455a-9068-ca0d0f5e6e6a',
       amount: 0.003312,
       currency: 'usdt',
       network_fee: 0.003312,
       trade_id: 330100,
       timestamp: '2022-06-27T17:48:17.884Z',
       exchange_id: 935,
       user_id: 2228 }, //this is where these fees have gone 
       
       //generated fees for XHT
     { id: 71,
       transaction_id: '78c16133-abba-4e84-a48c-afc29c3f4afc',
       amount: 0.003,
       currency: 'xht',
       network_fee: 0.003,
       trade_id: 330100,
       timestamp: '2022-06-27T17:48:17.884Z',
       exchange_id: 935,
       user_id: 2228 } ] }
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hollaex.com/advanced/the-network-tool-library/getting-more-interesting-orders-with-the-tools/settling-fees.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
