Heat oil in a wide frying pan and fry onion, garlic, ginger and chilli until softened and beginning to colour. Stir in green masala paste and fry for another 2 minutes, or until fragrant.
Add flour and cook, stirring constantly, over low heat until paste has thickened. Add coconut milk, stock, tamarind liquid, sugar and fish sauce and simmer for 10 minutes.