func (am AccountManager) MoveBetweenPools(ctx sdk.Context, from, to linotypes.PoolName, amount linotypes.Coin) sdk.Error {
	if amount.IsNegative() {
		return types.ErrNegativeMoveAmount(amount)
	}
	fromPool, err := am.storage.GetPool(ctx, from)
	if err != nil {
		return err
	}
	toPool, err := am.storage.GetPool(ctx, to)
	if err != nil {
		return err
	}
	if !fromPool.Balance.IsGTE(amount) {
		return types.ErrPoolNotEnough(from)
	}
	fromPool.Balance = fromPool.Balance.Minus(amount)
	toPool.Balance = toPool.Balance.Plus(amount)
	am.storage.SetPool(ctx, fromPool)
	am.storage.SetPool(ctx, toPool)
	return nil
}
MoveBetweenPools, move coin between pools.
package manager
import (
	"bytes"
	"fmt"
	"reflect"
	codec "github.com/cosmos/cosmos-sdk/codec"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/tendermint/tendermint/crypto"
	"github.com/lino-network/lino/param"
	linotypes "github.com/lino-network/lino/types"
	"github.com/lino-network/lino/utils"
	"github.com/lino-network/lino/x/account/model"
	"github.com/lino-network/lino/x/account/types"
)
const (
	nSecOfOneHour = 3600
	nHourOfOneYear = 8766
	exportVersion = 3
	importVersion = 3
)
type AccountManager struct {
	storage     model.AccountStorage
	paramHolder param.ParamKeeper
}
func NewAccountManager(key sdk.StoreKey, holder param.ParamKeeper) AccountManager {
	return AccountManager{
		storage:     model.NewAccountStorage(key),
		paramHolder: holder,
	}
}
func (am AccountManager) InitGenesis(ctx sdk.Context, total linotypes.Coin, pools []model.Pool) {
	neverInited := false
	func() {
		defer func() {
			if r := recover(); r != nil {
				neverInited = true
			}
		}()
		am.storage.GetSupply(ctx)
	}()
	if !neverInited {
		panic("Account Module Already Inited")
	}
	am.storage.SetSupply(ctx, &model.Supply{
		LastYearTotal:     total,
		Total:             total,
		ChainStartTime:    ctx.BlockTime().Unix(),
		LastInflationTime: ctx.BlockTime().Unix(),
	})
	for _, pool := range pools {
		am.storage.SetPool(ctx, &pool)
	}
}
func (am AccountManager) GetPool(
	ctx sdk.Context, poolName linotypes.PoolName) (linotypes.Coin, sdk.Error) {
	pool, err := am.storage.GetPool(ctx, poolName)
	if err != nil {
		return linotypes.NewCoinFromInt64(0), err
	}
	return pool.Balance, nil
}
func (am AccountManager) MoveCoin(ctx sdk.Context, sender, receiver linotypes.AccOrAddr, coin linotypes.Coin) sdk.Error {
	if coin.IsNegative() {
		return types.ErrNegativeMoveAmount(coin)
	}
	err := am.minusCoin(ctx, sender, coin)
	if err != nil {
		return err
	}
	return am.addCoin(ctx, receiver, coin)
}
func (am AccountManager) MoveFromPool(ctx sdk.Context, poolName linotypes.PoolName, dest linotypes.AccOrAddr, amount linotypes.Coin) sdk.Error {
	if amount.IsNegative() {
		return types.ErrNegativeMoveAmount(amount)
	}
	pool, err := am.storage.GetPool(ctx, poolName)
	if err != nil {
		return err
	}
	if !pool.Balance.IsGTE(amount) {
		return types.ErrPoolNotEnough(poolName)
	}
	pool.Balance = pool.Balance.Minus(amount)
	am.storage.SetPool(ctx, pool)
	return am.addCoin(ctx, dest, amount)
}
func (am AccountManager) MoveToPool(ctx sdk.Context, poolName linotypes.PoolName, from linotypes.AccOrAddr, amount linotypes.Coin) sdk.Error {
	if amount.IsNegative() {
		return types.ErrNegativeMoveAmount(amount)
	}
	err := am.minusCoin(ctx, from, amount)
	if err != nil {
		return err
	}
	pool, err := am.storage.GetPool(ctx, poolName)
	if err != nil {
		return err
	}
	pool.Balance = pool.Balance.Plus(amount)
	am.storage.SetPool(ctx, pool)
	return nil
}