1

I’m trying to have a rolling tax on a coin based on the amount of time since the last buy

I’m realizing that bots are buying and selling and scalping market cap due to low defi tax.

So what I’m trying to do is say

If user trying to sell first bought in the last hour - 25% tax

Last day - 20% All the way down to zero

Is this possible in solidity?

1
  • Actually if you need help with this you can reach me there slawek1211 (at@) gmail.com
    – Slawek
    Commented May 4, 2021 at 15:33

1 Answer 1

0

Sure, that's possible. Buy is a send from LP to wallet, sell is a send from wallet to LP. All you need to do is to add last transaction time in transfer function, with destination then check last transaction time of source address. Plus a function to limit it to exchange LPs if you like to limit only for exchanges.

OnTransfer pseudo code:
map[destination_wallet] = now
if (map[source_wallet] > 0)
{
  elapsed = now - map[source_address]
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.