Rule uk_stamp_duty v1

The SDLT rate band a residential purchase falls in, and the surcharge on a second home. Transcribed from GOV.UK

Try a case

Enter the inputs: the rows that match light up and the outputs appear. What runs is the generated code itself, and the line it would write to a log is shown as it is.


Inputs

NameTypeRangeNotes
pricemoney[GBP]0GBP to 20_000_000GBP
first_timebool
additionalbool

Outputs

NameTypeRoundingNotes
bandratedown(1%) (rounded down to 1%)
surchargeratedown(1%) (rounded down to 1%)

Table standard (policy unique)

ColumnSource
priceInput
→ bandOutput of this rule
#price→ band (rate / down(1%))Notes
1<=125000GBP (125000GBP or less)0%
2>125000GBP <=250000GBP (more than 125000GBP and 250000GBP or less)2%Source: gov table1
3>250000GBP <=925000GBP (more than 250000GBP and 925000GBP or less)5%Source: gov table1
4>925000GBP <=1500000GBP (more than 925000GBP and 1500000GBP or less)10%Source: gov table1
5>1500000GBP (more than 1500000GBP)12%Source: gov table1

What rulec check verified is under "How band is decided".

Table first_time_relief (policy unique)

Source: gov table2 (sources/uk-sdlt.md, sha256:799106ea8a821a00)

Property price bandSDLT rate
Up to £300,0000%
£300,001 to £500,0005%
ColumnSource
first_timeInput
additionalInput
priceInput
→ bandOutput of this rule
#first_timeadditionalprice→ band (rate / down(1%))
1true (yes)false (no)<=300000GBP (300000GBP or less)0%
2true (yes)false (no)>300000GBP <=500000GBP (more than 300000GBP and 500000GBP or less)5%

What rulec check verified is under "How band is decided".

Table second_home (policy unique)

Source: gov (sources/uk-sdlt.md, sha256:799106ea8a821a00)

ColumnSource
additionalInput
→ surchargeOutput of this rule
#additional→ surcharge (rate / down(1%))
1true (yes)5%
2false (no)0%

What rulec check verified

How band is decided

band is defined by table standard, table first_time_relief; they are tried in the order table first_time_relief, table standard, and the first that applies is the answer.

What rulec check verified

Examples (verified)

pricefirst_timeadditional→ bandsurcharge
100000GBPfalsefalse0%0%
200000GBPfalsefalse2%0%
200000GBPtruefalse0%0%
400000GBPtruefalse5%0%
600000GBPtruefalse5%0%
200000GBPfalsetrue2%5%
2000000GBPfalsefalse12%0%

rulec check ran these 7 examples through the reference evaluator, and every one produced the declared values (E107). The examples are an executable specification.