[](https://travis-ci.com/eden-js/balance) [](https://github.com/eden-js/balance/issues) [;
// get first entry
const entry = await BalanceEntry.findOne();
// data used in frontend
const data = await entry.sanitise();
`
Balance change hook allows us to prevent/change a balance transaction on a user based on parameters.
#### Example
`js
this.eden.pre('balance.change', (data) => {
// extract variables
const { user, direction, amount, payment, current } = data;
// prevent balance change by setting prevent : true
data.prevent = true;
data.complete = true;
});
`
Balance helper applies balance changes to users automatically.
#### Example
`js
// user model
const User = model('user');
// balance helper
const balanceHelper = helper('balance');
const balanceUser = await User.findOne();
const didAdd = await balanceHelper.add(balanceUser, 10); // add 10 to users account
const didSubtract = await balanceHelper.subtract(balanceUser, 10); // subtract 10 from users account
``