A decentralised finance project has been hacked and $US30 million ($38.9 million) drained from its system in the latest embarrassment to plague the fast-growing space.

The hacker exploited a flaw in the smart contract that governs the Spartan Protocol, a DeFi token on the Binance Smart Chain, to take the funds over the weekend.

Similar to the Ethereum-based Synthetix, the Spartan project aimed to create synthetic tradeable assets that reflect the value of other assets.

Unlike traditional exchanges such as the ASX that rely on an order book that pairs buyers with sellers, the new generation of crypto decentralised exchanges feature an automated market maker function in which assets are priced via algorithm. In exchange for rewards, users commit their tokens to a liquidity pool so they can be traded against.

It’s that pool that the hacker drained. Just last week, a hacker used a similar exploit to drain $US50 million from a Uniswap clone, Uranium Finance.

Blockchain security company PeckShield wrote in a detailed Medium post that the incident “was due to a flawed logic in calculating the liquidity share when the pool token is burned to withdraw the underlying assets”.

“In particular, the specific hack inflates the asset balance of the pool before burning the same amount of pool tokens to claim an unnecessarily large amount of underlying assets,” PeckShield said.

The price of the Spartan Protocol’s SPARTA token dropped from $US1.66 to as low as $US1 over the weekend but had rebounded Monday, trading this afternoon at $US1.51.

The token has a collective value of $US99 million, making it the 434th most valuable coin on Coinmarketcap.

Join our Cryptohead Facebook group to discuss all things cryptocurrency.